For now in some code path, even if it can be removed we still set MadeChanges to true. This patch fix them to make sure the MadeChanges set to true only if it is really changed.
Diff Detail
Event Timeline
llvm/lib/Transforms/Utils/SCCPSolver.cpp | ||
---|---|---|
238 ↗ | (On Diff #500652) | tryToReplaceWithConstant will return true if it made a change and we should set the flag regardless of whether we can remove the instruction. |
llvm/lib/Transforms/IPO/SCCP.cpp | ||
---|---|---|
215 | Even in this case we're going to do a changeToUnreachable() below, so it's still changed? |
llvm/lib/Transforms/IPO/SCCP.cpp | ||
---|---|---|
215 | Oh thanks for the mention. You are right, generally it will change first non-phi instruction to unreachable. |
Even in this case we're going to do a changeToUnreachable() below, so it's still changed?