[PATCH] D43256: [MBP] Move a latch block with conditional exit and multi predecessors to top of loop

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 16:21:09 PDT 2019


davidxl added inline comments.


================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:1959
   // that can fallthrough and that is also placed before the header.
   if (F->getFunction().hasOptSize())
+    return OldTop;
----------------
Move this checked into the caller function


================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:1991
+        OutBB = *Pred->succ_rbegin();
+      if (LoopBlockSet.count(OutBB))
+        continue;
----------------
This check is not necessary. See example at https://reviews.llvm.org/F8921829

If B6 is selected as the new loop top, the fall through frequencies can be increased from 99 to 150.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D43256/new/

https://reviews.llvm.org/D43256





More information about the llvm-commits mailing list