Skip to content

Commit

Permalink
[InstCombine] Address review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcxzyw committed Nov 16, 2024
1 parent 60e6592 commit d2a5040
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,9 @@ Instruction *InstCombinerImpl::visitAdd(BinaryOperator &I) {
if (Instruction *Res = foldBinOpOfSelectAndCastOfSelectCondition(I))
return Res;

if (Changed) {
// Re-enqueue add instruction with PHI operands if we infer new nuw/nsw flags.
if (Changed &&
(isa<PHINode>(I.getOperand(0)) || isa<PHINode>(I.getOperand(1)))) {
for (User *U : I.users()) {
if (auto *PHI = dyn_cast<PHINode>(U))
Worklist.pushUsersToWorkList(*PHI);
Expand Down

0 comments on commit d2a5040

Please sign in to comment.