[PATCH] D53747: [SimpleLoopUnswitch] Make all checks before actual non-trivial unswitch

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 26 02:29:23 PDT 2018


chandlerc accepted this revision.
chandlerc added a comment.
This revision is now accepted and ready to land.

Awesome improvement, thanks!

LGTM. Minor tweak or follow-up suggested below.



================
Comment at: lib/Transforms/Scalar/SimpleLoopUnswitch.cpp:1799
     function_ref<void(bool, ArrayRef<Loop *>)> UnswitchCB,
-    ScalarEvolution *SE) {
+    ScalarEvolution *SE, SmallVectorImpl<BasicBlock *> &ExitBlocks) {
   auto *ParentBB = TI.getParent();
----------------
Maybe make this come before the dom tree? I'd generally prefer roughly grouped params... but SCEV is already a bit out-of-order, so also fine to clean up the grouping of parameters in a follow-up, whatever is easiest. I think the best ordering here would be: loop, terminator, invarianst, exit blocks, callback, analyses-used.


https://reviews.llvm.org/D53747





More information about the llvm-commits mailing list