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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 12 19:59:56 PDT 2018


mkazantsev added a comment.

Actually I've checked `getExitBlocks` and it simply iterates through all loop blocks and checks its successors. So the complexity of the old algorithm is O(NumAllBlocks+ NumSuccessorsOfAllBlocks). The new algorithm collects transitive predecessors of a block and checks their successors, so its complexity is O(NumPredecessors+ NumSuccessorsOfPredecessors). Which is strictly not greater than the old algorithm. So this patch reduces complexity, not increases it. :)


https://reviews.llvm.org/D50558





More information about the llvm-commits mailing list