[PATCH] D50558: [MustExecute] Fix algorithmic bug in isGuaranteedToExecute. PR38514

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 12 20:27:22 PDT 2018


skatkov added inline comments.


================
Comment at: lib/Analysis/MustExecute.cpp:197
+          Succ != BB && !Predecessors.count(Succ))
+        // Okay, if the successor is neither the BB nor one of its predecessors,
+        // but if it an exit block which is not reached on the 1st iteration, we
----------------
I would say this comment is a bit messy. Instead, I would suggest to update the comment before the first loop which is pretty clear to add an info that we could also handle not only exit blocks but also loop blocks but CanProveNotTakenFirstIteration is written to support only exit blocks. Another to do might be to support not only 1st iteration but others as well. But it will significantly increase the complexity of your algorithm.


https://reviews.llvm.org/D50558





More information about the llvm-commits mailing list