Skip to content

Commit b8a977d

Browse files
committed
Correctly guard foldAddLike for or
1 parent f5ee61a commit b8a977d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3576,8 +3576,9 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
35763576
if (Instruction *R = tryFoldInstWithCtpopWithNot(&I))
35773577
return R;
35783578

3579-
if (Instruction *R = foldAddLike(I))
3580-
return R;
3579+
if (cast<PossiblyDisjointInst>(I).isDisjoint())
3580+
if (Instruction *R = foldAddLike(I))
3581+
return R;
35813582

35823583
Value *X, *Y;
35833584
const APInt *CV;

0 commit comments

Comments
 (0)