Index: lib/Transforms/InstCombine/InstructionCombining.cpp =================================================================== --- lib/Transforms/InstCombine/InstructionCombining.cpp +++ lib/Transforms/InstCombine/InstructionCombining.cpp @@ -330,6 +330,9 @@ ClearSubclassDataAfterReassociation(I); } + Worklist.Add(Op0); + if (auto *CI = dyn_cast(C)) + Worklist.Add(CI); Changed = true; ++NumReassoc; continue; @@ -350,6 +353,9 @@ // Conservatively clear the optional flags, since they may not be // preserved by the reassociation. ClearSubclassDataAfterReassociation(I); + if (auto *AI = dyn_cast(A)) + Worklist.Add(AI); + Worklist.Add(Op1); Changed = true; ++NumReassoc; continue; @@ -378,6 +384,9 @@ // Conservatively clear the optional flags, since they may not be // preserved by the reassociation. ClearSubclassDataAfterReassociation(I); + Worklist.Add(Op0); + if (auto *CI = dyn_cast(C)) + Worklist.Add(CI); Changed = true; ++NumReassoc; continue; @@ -398,6 +407,9 @@ // Conservatively clear the optional flags, since they may not be // preserved by the reassociation. ClearSubclassDataAfterReassociation(I); + if (auto *AI = dyn_cast(A)) + Worklist.Add(AI); + Worklist.Add(Op1); Changed = true; ++NumReassoc; continue; @@ -426,6 +438,8 @@ // Conservatively clear the optional flags, since they may not be // preserved by the reassociation. ClearSubclassDataAfterReassociation(I); + Worklist.Add(Op0); + Worklist.Add(Op1); Changed = true; continue;