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/X86/X86ISelPattern.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/X86/X86ISelPattern.cpp')
-rw-r--r-- | lib/Target/X86/X86ISelPattern.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Target/X86/X86ISelPattern.cpp b/lib/Target/X86/X86ISelPattern.cpp index ff0ee633ff..9f602418ab 100644 --- a/lib/Target/X86/X86ISelPattern.cpp +++ b/lib/Target/X86/X86ISelPattern.cpp @@ -2329,7 +2329,8 @@ unsigned ISel::SelectExpr(SDOperand N) { addFrameReference(BuildMI(BB, X86::LEA32r, 4, Result), (int)Tmp1); return Result; case ISD::ConstantPool: - Tmp1 = cast<ConstantPoolSDNode>(N)->getIndex(); + Tmp1 = BB->getParent()->getConstantPool()-> + getConstantPoolIndex(cast<ConstantPoolSDNode>(N)->get()); addConstantPoolReference(BuildMI(BB, X86::LEA32r, 4, Result), Tmp1); return Result; case ISD::ConstantFP: @@ -3317,8 +3318,10 @@ unsigned ISel::SelectExpr(SDOperand N) { } if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(N.getOperand(1))){ + unsigned CPIdx = BB->getParent()->getConstantPool()-> + getConstantPoolIndex(CP->get()); Select(N.getOperand(0)); - addConstantPoolReference(BuildMI(BB, Opc, 4, Result), CP->getIndex()); + addConstantPoolReference(BuildMI(BB, Opc, 4, Result), CPIdx); } else { X86AddressMode AM; @@ -3370,8 +3373,10 @@ unsigned ISel::SelectExpr(SDOperand N) { if (Node->getValueType(0) == MVT::f64) { assert(cast<VTSDNode>(Node->getOperand(3))->getVT() == MVT::f32 && "Bad EXTLOAD!"); - addConstantPoolReference(BuildMI(BB, X86::FLD32m, 4, Result), - CP->getIndex()); + unsigned CPIdx = BB->getParent()->getConstantPool()-> + getConstantPoolIndex(cast<ConstantPoolSDNode>(N)->get()); + + addConstantPoolReference(BuildMI(BB, X86::FLD32m, 4, Result), CPIdx); return Result; } |