diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-26 17:15:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-26 17:15:30 +0000 |
commit | 5839bf2b3bd22689d9dd0e9de66c2dce71d130ae (patch) | |
tree | 4480de7555efc3cac705ebc1b01e4d702473a7fe /lib/Target/IA64/IA64ISelPattern.cpp | |
parent | 95e0682a4276fb9f5978039dc4bae675bdf66ee3 (diff) |
Change ConstantPoolSDNode to actually hold the Constant itself instead of
putting it into the constant pool. This allows the isel machinery to
create constants that it will end up deciding are not needed, without them
ending up in the resultant function constant pool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23081 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/IA64/IA64ISelPattern.cpp')
-rw-r--r-- | lib/Target/IA64/IA64ISelPattern.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Target/IA64/IA64ISelPattern.cpp b/lib/Target/IA64/IA64ISelPattern.cpp index c0af342716..32aa94ac58 100644 --- a/lib/Target/IA64/IA64ISelPattern.cpp +++ b/lib/Target/IA64/IA64ISelPattern.cpp @@ -956,7 +956,8 @@ unsigned ISel::SelectExpr(SDOperand N) { } case ISD::ConstantPool: { - Tmp1 = cast<ConstantPoolSDNode>(N)->getIndex(); + Tmp1 = BB->getParent()->getConstantPool()-> + getConstantPoolIndex(cast<ConstantPoolSDNode>(N)->get()); IA64Lowering.restoreGP(BB); // FIXME: do i really need this? BuildMI(BB, IA64::ADD, 2, Result).addConstantPoolIndex(Tmp1) .addReg(IA64::r1); @@ -1974,10 +1975,12 @@ pC = pA OR pB BuildMI(BB, IA64::CMPNE, 2, Result).addReg(dummy3).addReg(IA64::r0); } } else if(ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Address)) { + unsigned CPIdx = BB->getParent()->getConstantPool()-> + getConstantPoolIndex(cast<ConstantPoolSDNode>(N)->get()); Select(Chain); IA64Lowering.restoreGP(BB); unsigned dummy = MakeReg(MVT::i64); - BuildMI(BB, IA64::ADD, 2, dummy).addConstantPoolIndex(CP->getIndex()) + BuildMI(BB, IA64::ADD, 2, dummy).addConstantPoolIndex(CPIdx) .addReg(IA64::r1); // CPI+GP if(!isBool) BuildMI(BB, Opc, 1, Result).addReg(dummy); |