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 | 8101682108a26049367567a8fbc0ecaf7307481b (patch) | |
| tree | 03b34bf45cb5dc8bc25cf7aba2987e2ec447b973 /lib | |
| parent | d6967f3865749675ab22ed1d1897e1164c03c3bf (diff) | |
| download | external_llvm-8101682108a26049367567a8fbc0ecaf7307481b.zip external_llvm-8101682108a26049367567a8fbc0ecaf7307481b.tar.gz external_llvm-8101682108a26049367567a8fbc0ecaf7307481b.tar.bz2 | |
Fix SimplifyDemandedBits' AssertZext logic to demand all the bits. It
needs to demand the high bits because it's asserting that they're zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105406 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 44a80d3..1cca100 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/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; } |
