[PATCH] D20991: Set machine block placement hot prob threshold for both static and runtime profile.

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 10 19:11:54 PDT 2016


davidxl added a comment.

This function has gone bloated recently and needs some cleanups. I will first do a couple of NFC cleans so that it is in a form that is more friendly to inject cost based analysis first, you can then adapt your patch based on that.


================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:472
@@ +471,3 @@
+    // We compare P(AB)*2 with P(AC) to find the best successor of A.
+    if (Successors.size() == 2) {
+      MachineBasicBlock *OtherSucc = NULL;
----------------
It should look at the predecessors of the block C/'Succ' and find a Pred/B that is a candidate to be scheduled -- simliar to the confilct detection down below.

================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:479
@@ +478,3 @@
+        }
+      if (Succ->succ_size() == 1 && *Succ->succ_begin() == OtherSucc)
+        SuccProbN *= 2;
----------------
This condition does not look correct.

================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:481
@@ +480,3 @@
+        SuccProbN *= 2;
+    }
+
----------------
Should it adjust threshold BB instead?


http://reviews.llvm.org/D20991





More information about the llvm-commits mailing list