aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-06-02 19:57:47 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-06-02 19:57:47 +0000
commitaa318ae495e9429c71a7382e164991b0df02f763 (patch)
tree341642dd01da1c8e748d60dfa833d50ac826efe9 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent351422bdc8c24ae8aecdc5f39ef059b40d3540ca (diff)
downloadllvm-aa318ae495e9429c71a7382e164991b0df02f763.zip
llvm-aa318ae495e9429c71a7382e164991b0df02f763.tar.gz
llvm-aa318ae495e9429c71a7382e164991b0df02f763.tar.bz2
Revert 132424 to fix PR10068.
llvm-svn: 132479
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 2eee501..bb4df27 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1759,14 +1759,13 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,
if (NewMask == APInt::getSignBit(Op.getValueType().getSizeInBits()) &&
Op.getOperand(0).getValueType().isFloatingPoint() &&
!Op.getOperand(0).getValueType().isVector()) {
- bool OpVTLegal = isOperationLegalOrCustom(ISD::FGETSIGN, Op.getValueType());
- bool i32Legal = isOperationLegalOrCustom(ISD::FGETSIGN, MVT::i32);
- if (OpVTLegal || i32Legal) {
- EVT Ty = OpVTLegal ? Op.getValueType() : MVT::i32;
+ if (isOperationLegalOrCustom(ISD::FGETSIGN, MVT::i32)) {
+ EVT Ty = (isOperationLegalOrCustom(ISD::FGETSIGN, Op.getValueType())) ?
+ Op.getValueType() : MVT::i32;
// 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, dl, Ty, Op.getOperand(0));
- if (!OpVTLegal)
+ if (Ty != Op.getValueType())
Sign = TLO.DAG.getNode(ISD::ZERO_EXTEND, dl, Op.getValueType(), Sign);
unsigned ShVal = Op.getValueType().getSizeInBits()-1;
SDValue ShAmt = TLO.DAG.getConstant(ShVal, Op.getValueType());