diff options
| author | Stuart Hastings <stuart@apple.com> | 2011-05-19 18:48:20 +0000 |
|---|---|---|
| committer | Stuart Hastings <stuart@apple.com> | 2011-05-19 18:48:20 +0000 |
| commit | 4a4e5a2b55136e3e3efd6549c2e988487ca25b62 (patch) | |
| tree | 69fba62227fa575184891e4222172decd1546205 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
| parent | b487d2d8158cd38bb44a35bf9e81fd3c011b8b49 (diff) | |
| download | llvm-4a4e5a2b55136e3e3efd6549c2e988487ca25b62.zip llvm-4a4e5a2b55136e3e3efd6549c2e988487ca25b62.tar.gz llvm-4a4e5a2b55136e3e3efd6549c2e988487ca25b62.tar.bz2 | |
Update some currently-disabled code, preparing for eventual use.
llvm-svn: 131663
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index b301e3b..a83bd4f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1728,19 +1728,20 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, #if 0 // If this is an FP->Int bitcast and if the sign bit is the only thing that // is demanded, turn this into a FGETSIGN. - if (NewMask == EVT::getIntegerVTSignBit(Op.getValueType()) && - MVT::isFloatingPoint(Op.getOperand(0).getValueType()) && - !MVT::isVector(Op.getOperand(0).getValueType())) { + if (NewMask == APInt::getSignBit(Op.getValueType().getSizeInBits()) && + Op.getOperand(0).getValueType().isFloatingPoint() && + !Op.getOperand(0).getValueType().isVector()) { // Only do this xform if FGETSIGN is valid or if before legalize. - if (!TLO.AfterLegalize || + if (TLO.isBeforeLegalize() || isOperationLegal(ISD::FGETSIGN, Op.getValueType())) { // Make a FGETSIGN + SHL to move the sign bit into the appropriate // place. We expect the SHL to be eliminated by other optimizations. - SDValue Sign = TLO.DAG.getNode(ISD::FGETSIGN, Op.getValueType(), + SDValue Sign = TLO.DAG.getNode(ISD::FGETSIGN, dl, Op.getValueType(), Op.getOperand(0)); unsigned ShVal = Op.getValueType().getSizeInBits()-1; SDValue ShAmt = TLO.DAG.getConstant(ShVal, getShiftAmountTy()); - return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SHL, Op.getValueType(), + return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SHL, dl, + Op.getValueType(), Sign, ShAmt)); } } |
