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 | fb2969205596dd8f0c5995e446f01a7b918fa4cf (patch) | |
tree | c43784f9ee0aa90e69598c917749d03bd16ffbea /llvm/lib/Transforms/Scalar/InstructionCombining.cpp | |
parent | 618ff2dc4ee163612631a53dcdb8e4272badaf1c (diff) | |
download | bcm5719-llvm-fb2969205596dd8f0c5995e446f01a7b918fa4cf.tar.gz bcm5719-llvm-fb2969205596dd8f0c5995e446f01a7b918fa4cf.zip |
Fix Transforms/InstCombine/2006-05-04-DemandedBitCrash.ll
llvm-svn: 28101
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 7e9c3841cce..dfd568c33e1 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/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; |