We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60e6592 commit d2a5040Copy full SHA for d2a5040
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -1868,7 +1868,9 @@ Instruction *InstCombinerImpl::visitAdd(BinaryOperator &I) {
1868
if (Instruction *Res = foldBinOpOfSelectAndCastOfSelectCondition(I))
1869
return Res;
1870
1871
- if (Changed) {
+ // Re-enqueue add instruction with PHI operands if we infer new nuw/nsw flags.
1872
+ if (Changed &&
1873
+ (isa<PHINode>(I.getOperand(0)) || isa<PHINode>(I.getOperand(1)))) {
1874
for (User *U : I.users()) {
1875
if (auto *PHI = dyn_cast<PHINode>(U))
1876
Worklist.pushUsersToWorkList(*PHI);
0 commit comments