[PATCH] D34516: [LoopDeletion] Update exits correctly when multiple duplicate edges from an exiting block

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 12:27:24 PDT 2017


efriedma added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopDeletion.cpp:250
     if (LoopIsNeverExecuted)
-      P->setIncomingValue(j, UndefValue::get(P->getType()));
-    P->setIncomingBlock(j, Preheader);
-    for (unsigned i = 1; i < ExitingBlocks.size(); ++i)
-      P->removeIncomingValue(ExitingBlocks[i]);
+      P->setIncomingValue(PredIndex, UndefValue::get(P->getType()));
+    P->setIncomingBlock(PredIndex, Preheader);
----------------
Do you need to call setIncomingValue() in the case where LoopIsNeverExecuted is false?


================
Comment at: lib/Transforms/Scalar/LoopDeletion.cpp:253
+    // Removes all incoming values from all other exiting blocks (including
+    // duplicate values from ExitingBlock).
+    // Nuke all entries except the zero'th entry which is the preheader entry.
----------------
There is no variable named ExitingBlock.


https://reviews.llvm.org/D34516





More information about the llvm-commits mailing list