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/CodeGen/SelectionDAG/LegalizeDAG.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/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index d94e8026dd..dc706c1eea 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -12,7 +12,6 @@ //===----------------------------------------------------------------------===// #include "llvm/CodeGen/SelectionDAG.h" -#include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/Support/MathExtras.h" @@ -248,9 +247,7 @@ SDOperand SelectionDAGLegalize::ExpandLegalINT_TO_FP(bool isSigned, if (TLI.isLittleEndian()) FF <<= 32; static Constant *FudgeFactor = ConstantUInt::get(Type::ULongTy, FF); - MachineConstantPool *CP = DAG.getMachineFunction().getConstantPool(); - SDOperand CPIdx = DAG.getConstantPool(CP->getConstantPoolIndex(FudgeFactor), - TLI.getPointerTy()); + SDOperand CPIdx = DAG.getConstantPool(FudgeFactor, TLI.getPointerTy()); CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset); SDOperand FudgeInReg; if (DestVT == MVT::f32) @@ -529,8 +526,6 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { if (!isLegal) { // Otherwise we need to spill the constant to memory. - MachineConstantPool *CP = DAG.getMachineFunction().getConstantPool(); - bool Extend = false; // If a FP immediate is precise when represented as a float, we put it @@ -549,8 +544,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { Extend = true; } - SDOperand CPIdx = DAG.getConstantPool(CP->getConstantPoolIndex(LLVMC), - TLI.getPointerTy()); + SDOperand CPIdx = DAG.getConstantPool(LLVMC, TLI.getPointerTy()); if (Extend) { Result = DAG.getExtLoad(ISD::EXTLOAD, MVT::f64, DAG.getEntryNode(), CPIdx, DAG.getSrcValue(NULL), MVT::f32); @@ -2751,9 +2745,7 @@ ExpandIntToFP(bool isSigned, MVT::ValueType DestTy, SDOperand Source) { if (TLI.isLittleEndian()) FF <<= 32; static Constant *FudgeFactor = ConstantUInt::get(Type::ULongTy, FF); - MachineConstantPool *CP = DAG.getMachineFunction().getConstantPool(); - SDOperand CPIdx = DAG.getConstantPool(CP->getConstantPoolIndex(FudgeFactor), - TLI.getPointerTy()); + SDOperand CPIdx = DAG.getConstantPool(FudgeFactor, TLI.getPointerTy()); CPIdx = DAG.getNode(ISD::ADD, TLI.getPointerTy(), CPIdx, CstOffset); SDOperand FudgeInReg; if (DestTy == MVT::f32) |