diff options
author | Dan Gohman <gohman@apple.com> | 2010-06-03 20:21:33 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-06-03 20:21:33 +0000 |
commit | d83e3e7750f29c1e2dde2d1e48c2d74861cd3cd6 (patch) | |
tree | 2edafff0f4cd5d289afffbc9d5188d845f554f2a /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | cce5b81ce157a032c8ac7ffcefc0c1ea9871c814 (diff) | |
download | bcm5719-llvm-d83e3e7750f29c1e2dde2d1e48c2d74861cd3cd6.tar.gz bcm5719-llvm-d83e3e7750f29c1e2dde2d1e48c2d74861cd3cd6.zip |
Fix SimplifyDemandedBits' AssertZext logic to demand all the bits. It
needs to demand the high bits because it's asserting that they're zero.
llvm-svn: 105406
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 44a80d3362d..1cca100d56f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1498,13 +1498,17 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, break; } case ISD::AssertZext: { - EVT VT = cast<VTSDNode>(Op.getOperand(1))->getVT(); - APInt InMask = APInt::getLowBitsSet(BitWidth, - VT.getSizeInBits()); - if (SimplifyDemandedBits(Op.getOperand(0), InMask & NewMask, + // Demand all the bits of the input that are demanded in the output. + // The low bits are obvious; the high bits are demanded because we're + // asserting that they're zero here. + if (SimplifyDemandedBits(Op.getOperand(0), NewMask, KnownZero, KnownOne, TLO, Depth+1)) return true; assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); + + EVT VT = cast<VTSDNode>(Op.getOperand(1))->getVT(); + APInt InMask = APInt::getLowBitsSet(BitWidth, + VT.getSizeInBits()); KnownZero |= ~InMask & NewMask; break; } |