Fix Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28101 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-05-04 17:33:35 +00:00
parent 2942da747c
commit e3158308e0

View File

@ -456,6 +456,8 @@ static void ComputeMaskedBits(Value *V, uint64_t Mask, uint64_t &KnownZero,
Instruction *I = dyn_cast<Instruction>(V);
if (!I) return;
Mask &= V->getType()->getIntegralTypeMask();
switch (I->getOpcode()) {
case Instruction::And:
// If either the LHS or the RHS are Zero, the result is zero.
@ -713,6 +715,8 @@ bool InstCombiner::SimplifyDemandedBits(Value *V, uint64_t DemandedMask,
Instruction *I = dyn_cast<Instruction>(V);
if (!I) return false; // Only analyze instructions.
DemandedMask &= V->getType()->getIntegralTypeMask();
uint64_t KnownZero2, KnownOne2;
switch (I->getOpcode()) {
default: break;