diff options
author | Chris Lattner <sabre@nondot.org> | 2006-05-04 17:33:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-05-04 17:33:35 +0000 |
commit | e3158308e0d51ce5c2624529e85c9a6be8f5ff46 (patch) | |
tree | e02debc6f1025c1b8bd97207b9a2d6cb2b201f6c /lib/Transforms | |
parent | 2942da747c5bb033e1c3c0f5ec63c49108ba3b26 (diff) | |
download | llvm-e3158308e0d51ce5c2624529e85c9a6be8f5ff46.tar.gz llvm-e3158308e0d51ce5c2624529e85c9a6be8f5ff46.tar.bz2 llvm-e3158308e0d51ce5c2624529e85c9a6be8f5ff46.tar.xz |
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 7e9c3841cc..dfd568c33e 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -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; |