diff options
author | Owen Anderson <resistor@mac.com> | 2008-09-05 23:36:01 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-09-05 23:36:01 +0000 |
commit | 1dd2e40521ba06c4b6fb6ff1ed7d6a92a462aa89 (patch) | |
tree | 02ac43d5c7fb13b9b07fd1e37cde6dded73b308e /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | a9c52c82194df21c7975bae3455d483cad87725d (diff) | |
download | bcm5719-llvm-1dd2e40521ba06c4b6fb6ff1ed7d6a92a462aa89.tar.gz bcm5719-llvm-1dd2e40521ba06c4b6fb6ff1ed7d6a92a462aa89.zip |
Revert r55859. This is breaking the build in the abscence of its companion commit.
llvm-svn: 55865
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 992b8edba4d..c109a096a1f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -35,7 +35,8 @@ unsigned FastISel::getRegForValue(Value *V) { MVT::SimpleValueType VT = TLI.getValueType(V->getType()).getSimpleVT(); if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { if (CI->getValue().getActiveBits() > 64) - return 0; + return TargetMaterializeConstant(CI, + MBB->getParent()->getConstantPool()); // Don't cache constant materializations. To do so would require // tracking what uses they dominate. Reg = FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue()); @@ -52,16 +53,19 @@ unsigned FastISel::getRegForValue(Value *V) { uint32_t IntBitWidth = IntVT.getSizeInBits(); if (Flt.convertToInteger(x, IntBitWidth, /*isSigned=*/true, APFloat::rmTowardZero) != APFloat::opOK) - return 0; + return TargetMaterializeConstant(CF, + MBB->getParent()->getConstantPool()); APInt IntVal(IntBitWidth, 2, x); unsigned IntegerReg = FastEmit_i(IntVT.getSimpleVT(), IntVT.getSimpleVT(), ISD::Constant, IntVal.getZExtValue()); if (IntegerReg == 0) - return 0; + return TargetMaterializeConstant(CF, + MBB->getParent()->getConstantPool()); Reg = FastEmit_r(IntVT.getSimpleVT(), VT, ISD::SINT_TO_FP, IntegerReg); if (Reg == 0) - return 0; + return TargetMaterializeConstant(CF, + MBB->getParent()->getConstantPool());; } } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { if (!SelectOperator(CE, CE->getOpcode())) return 0; @@ -73,6 +77,10 @@ unsigned FastISel::getRegForValue(Value *V) { return 0; } + if (!Reg && isa<Constant>(V)) + return TargetMaterializeConstant(cast<Constant>(V), + MBB->getParent()->getConstantPool()); + LocalValueMap[V] = Reg; return Reg; } |