From e3158308e0d51ce5c2624529e85c9a6be8f5ff46 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 4 May 2006 17:33:35 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/InstructionCombining.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 7e9c3841cce..dfd568c33e1 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(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(V); if (!I) return false; // Only analyze instructions. + DemandedMask &= V->getType()->getIntegralTypeMask(); + uint64_t KnownZero2, KnownOne2; switch (I->getOpcode()) { default: break;