From edd089c86a58d82a290701bedf5284489eae1ec5 Mon Sep 17 00:00:00 2001 From: Zhou Sheng Date: Mon, 12 Mar 2007 16:54:56 +0000 Subject: [PATCH] Avoid to assert on "(KnownZero & KnownOne) == 0". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35062 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/InstructionCombining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index abb279f7740..62a7a8dea4d 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -979,7 +979,7 @@ static bool MaskedValueIsZero(Value *V, uint64_t Mask, unsigned Depth = 0) { /// this predicate to simplify operations downstream. Mask is known to be zero /// for bits that V cannot have. static bool MaskedValueIsZero(Value *V, const APInt& Mask, unsigned Depth = 0) { - APInt KnownZero(Mask), KnownOne(Mask); + APInt KnownZero(Mask.getBitWidth(), 0), KnownOne(Mask.getBitWidth(), 0); ComputeMaskedBits(V, Mask, KnownZero, KnownOne, Depth); assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); return (KnownZero & Mask) == Mask; -- 2.34.1