[PATCH] D17625: Do not select EhPad BB in MachineBlockPlacement when there is regular BB to schedule

David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 12:28:07 PST 2016


davidxl added inline comments.

================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:420
@@ -405,3 +419,3 @@
     bool SkipSucc = false;
-    if (BlockFilter && !BlockFilter->count(Succ)) {
+    if (Succ->isEHPad() || (BlockFilter && !BlockFilter->count(Succ))) {
       SkipSucc = true;
----------------
Why is it always good to skip ehpad? With real profile data, can ehpad be 'hotter' than some of the cold blocks?

================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:561
@@ +560,3 @@
+
+    // For ehpad, we layout the least probable first as to avoid jumping back
+    // from least probable landingpads to more probable ones.
----------------
Your patch forces ehpad to be skipped when doing regular layout which is fine. However how is this following layout (enabled by this strategy)

    entry, hot, then, cold, clp, hlp, lpret

better than:

   entry, hot, then, cold, hlp, lpret, clp?


Of course, both are better than the following:

   entry, hot, then, cold, hlp, clp, lpret


http://reviews.llvm.org/D17625





More information about the llvm-commits mailing list