Skip to content

Commit d16b8d4

Browse files
committed
Correctly guard foldAddLike for or
1 parent 73f0712 commit d16b8d4

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
@@ -3580,8 +3580,9 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
35803580
if (Instruction *R = tryFoldInstWithCtpopWithNot(&I))
35813581
return R;
35823582

3583-
if (Instruction *R = foldAddLike(I))
3584-
return R;
3583+
if (cast<PossiblyDisjointInst>(I).isDisjoint())
3584+
if (Instruction *R = foldAddLike(I))
3585+
return R;
35853586

35863587
Value *X, *Y;
35873588
const APInt *CV;

0 commit comments

Comments
 (0)