Skip to content

Commit c72f7bb

Browse files
committed
don't open code bitwise not
1 parent db1316b commit c72f7bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ Instruction *InstCombinerImpl::foldIsMultipleOfAPowerOfTwo(ICmpInst &Cmp) {
13411341
// Check the constant case
13421342
if (match(Neg, m_APInt(NegConst)) && match(Mask, m_LowBitMask(MaskConst))) {
13431343
// Neg = -(Mask + 1)
1344-
if (*NegConst != -(*MaskConst + 1))
1344+
if (*NegConst != ~*MaskConst)
13451345
return nullptr;
13461346
} else {
13471347
// Match neg = sub 0, val

0 commit comments

Comments
 (0)