diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2010-08-02 04:42:25 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2010-08-02 04:42:25 +0000 |
commit | 460ad41d6d2e6af29d11b3e16345123503da19c4 (patch) | |
tree | 92897d1793a63e00db3bd5025db3d567189253bf /llvm/lib/CodeGen/SelectionDAG | |
parent | adaf5172bfc1130a9789a1c80d05b29029f40e5c (diff) | |
download | bcm5719-llvm-460ad41d6d2e6af29d11b3e16345123503da19c4.tar.gz bcm5719-llvm-460ad41d6d2e6af29d11b3e16345123503da19c4.zip |
PR7586: Make sure we don't claim that unknown bits are actually known in the
ISD::AND case of TargetLowering::SimplifyDemandedBits.
llvm-svn: 110019
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 908a9d8919d..9772d55449e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1497,11 +1497,10 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, // present in the input. APInt NewBits = APInt::getHighBitsSet(BitWidth, - BitWidth - EVT.getScalarType().getSizeInBits()) & - NewMask; + BitWidth - EVT.getScalarType().getSizeInBits()); // If none of the extended bits are demanded, eliminate the sextinreg. - if (NewBits == 0) + if ((NewBits & NewMask) == 0) return TLO.CombineTo(Op, Op.getOperand(0)); APInt InSignBit = APInt::getSignBit(EVT.getScalarType().getSizeInBits()); |