diff options
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index d3ccdcd5ffd..034591a00fe 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -791,6 +791,10 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, // TODO: Should we check for other forms of sign-bit comparisons? // Examples: X <= -1, X >= 0 } + if (getBooleanContents(Op0.getValueType()) == + TargetLowering::ZeroOrOneBooleanContent && + BitWidth > 1) + KnownZero.setBitsFrom(1); break; } case ISD::SHL: @@ -1233,7 +1237,7 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, return true; assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); - KnownZero |= ~InMask & NewMask; + KnownZero |= ~InMask; break; } case ISD::BITCAST: |