Skip to content

Commit 596ed89

Browse files
committed
[InstCombine] Address review comments.
1 parent 867bb0d commit 596ed89

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,8 +1738,8 @@ Instruction *InstCombinerImpl::foldICmpAndShift(ICmpInst &Cmp,
17381738

17391739
// Compute X & (C2 << Y).
17401740
Value *NewAnd = Builder.CreateAnd(Shift->getOperand(0), NewShift);
1741-
Cmp.setSameSign(false);
1742-
return replaceOperand(Cmp, 0, NewAnd);
1741+
return ICmpInst::Create(Instruction::ICmp, Cmp.getPredicate(), NewAnd,
1742+
Cmp.getOperand(1));
17431743
}
17441744

17451745
return nullptr;
@@ -1845,8 +1845,8 @@ Instruction *InstCombinerImpl::foldICmpAndConstConst(ICmpInst &Cmp,
18451845
/*HasNUW=*/true),
18461846
One, Or->getName());
18471847
Value *NewAnd = Builder.CreateAnd(A, NewOr, And->getName());
1848-
Cmp.setSameSign(false);
1849-
return replaceOperand(Cmp, 0, NewAnd);
1848+
return ICmpInst::Create(Instruction::ICmp, Cmp.getPredicate(), NewAnd,
1849+
Cmp.getOperand(1));
18501850
}
18511851
}
18521852
}

0 commit comments

Comments
 (0)