Skip to content

Commit 5fa229b

Browse files
committed
Fix crash due to mismatch APInt bitwidth
Change-Id: I12f77aedbf1a2edfe63e4d03cd1e5c1c601365a7
1 parent 7b63d9b commit 5fa229b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3650,7 +3650,8 @@ static std::optional<DecomposedBitMaskMul> matchBitmaskMul(Value *V) {
36503650

36513651
if (!ICmpInst::isEquality(ICmpDecompose->Pred) ||
36523652
!ICmpDecompose->C.isZero() || !ICmpDecompose->Mask.isPowerOf2() ||
3653-
ICmpDecompose->Mask.isZero())
3653+
ICmpDecompose->Mask.isZero() ||
3654+
NeZero->getBitWidth() != ICmpDecompose->Mask.getBitWidth())
36543655
return std::nullopt;
36553656

36563657
if (!NeZero->urem(ICmpDecompose->Mask).isZero())

0 commit comments

Comments
 (0)