[PATCH] D48421: [IPSCCP] Try to replace phis before they are removed by changeToUnreachable.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 21 12:01:32 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Transforms/Scalar/SCCP.cpp:2030
+          for (PHINode &PN : Successor->phis()) {
+            if (PN.getNumIncomingValues() != 2 ||
+                !Solver.isBlockExecutable(Successor))
----------------
The "PN.getNumIncomingValues() != 2" won't work correctly in all cases.

Instead of adding this extra loop, can you just delay the call to changeToUnreachable until after we've iterated over all the blocks?


https://reviews.llvm.org/D48421





More information about the llvm-commits mailing list