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/Alpha/AlphaISelPattern.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/Alpha/AlphaISelPattern.cpp')
-rw-r--r-- | lib/Target/Alpha/AlphaISelPattern.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Target/Alpha/AlphaISelPattern.cpp b/lib/Target/Alpha/AlphaISelPattern.cpp index e559852d2b..cf5245d19c 100644 --- a/lib/Target/Alpha/AlphaISelPattern.cpp +++ b/lib/Target/Alpha/AlphaISelPattern.cpp @@ -1216,7 +1216,8 @@ unsigned AlphaISel::SelectExpr(SDOperand N) { return Result; case ISD::ConstantPool: - Tmp1 = cast<ConstantPoolSDNode>(N)->getIndex(); + Tmp1 = BB->getParent()->getConstantPool()-> + getConstantPoolIndex(cast<ConstantPoolSDNode>(N)->get()); AlphaLowering.restoreGP(BB); Tmp2 = MakeReg(MVT::i64); BuildMI(BB, Alpha::LDAHr, 2, Tmp2).addConstantPoolIndex(Tmp1) @@ -1285,16 +1286,18 @@ unsigned AlphaISel::SelectExpr(SDOperand N) { .addGlobalAddress(GASD->getGlobal()).addReg(Tmp1); } else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Address)) { + unsigned CPIdx = BB->getParent()->getConstantPool()-> + getConstantPoolIndex(CP->get()); AlphaLowering.restoreGP(BB); has_sym = true; Tmp1 = MakeReg(MVT::i64); - BuildMI(BB, Alpha::LDAHr, 2, Tmp1).addConstantPoolIndex(CP->getIndex()) + BuildMI(BB, Alpha::LDAHr, 2, Tmp1).addConstantPoolIndex(CPIdx) .addReg(Alpha::R29); if (EnableAlphaLSMark) BuildMI(BB, Alpha::MEMLABEL, 4).addImm(i).addImm(j).addImm(k) .addImm(getUID()); BuildMI(BB, GetRelVersion(Opc), 2, Result) - .addConstantPoolIndex(CP->getIndex()).addReg(Tmp1); + .addConstantPoolIndex(CPIdx).addReg(Tmp1); } else if(Address.getOpcode() == ISD::FrameIndex) { if (EnableAlphaLSMark) BuildMI(BB, Alpha::MEMLABEL, 4).addImm(i).addImm(j).addImm(k) |