[PATCH] D30309: CodeGen: BlockPlacement: Precompute layout for chains of triangles.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 13:42:46 PST 2017


davidxl added a comment.

Add an internal option to allow precomputing to be disabled.



================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:1073
+/// Find chains of triangles where we believe it would be profitable to
+/// tail-duplicate them all, but a local analysis would not find them.
+void MachineBlockPlacement::precomputeTriangleChains() {
----------------
Add a little more comments here for the justification for doing this: cost based analysis compute layout costs by assuming full branch indepoendence which can lead to conservative result. In certain scenarios, the existence of branch correlation can make tail dup more beneficial ...


================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:1147
+    // existing chain
+    auto Found = TriangleChainMap.find(&BB);
+    // If it is, remove the chain from the map, grow it, and put it back in the
----------------
use the insert method so that you can modify the chain in place.


Repository:
  rL LLVM

https://reviews.llvm.org/D30309





More information about the llvm-commits mailing list