[llvm] [BasicBlockSections] Introduce the path cloning profile format to BasicBlockSectionsProfileReader. (PR #67214)

Sriraman Tallam via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 16:52:28 PDT 2023


================
@@ -61,8 +82,49 @@ BasicBlockSectionsProfileReader::getBBClusterInfoForFunction(
 // aliases. Basic block clusters are specified by 'c' and specify the cluster of
 // basic blocks, and the internal order in which they must be placed in the same
 // section.
+// This profile can also specify cloning paths which instruct the compiler to
+// clone basic blocks along a path. The cloned blocks are then specified in the
+// cluster information.
+// The following profile lists two cloning paths (starting with 'p') for
+// function bar and places the total 9 blocks within two clusters. The first two
+// blocks of a cloning path specify the edge along which the path is cloned. For
+// instance, path 1 (1 -> 3 -> 4) instructs that 3 and 4 must be cloned along
+// the edge 1->3. Within the given clusters, each cloned block is identified by
+// "<original block id>.<clone id>". For instance, 3.1 represents the first
+// clone of block 3. Original blocks are specified just with their block ids. A
+// block cloned multiple times appears with distinct clone ids. The CFG for bar
+// is shown below before and after cloning with its final clusters labeled.
+//
+// f main
+// f bar
+// p 1 3 4           # cloning path 1
+// p 4 2             # cloning path 2
----------------
tmsri wrote:

Sorry, I think I confused 'c' which is clusters from 'p' which is cloning paths.  I am convinced that 'p' is quite optimal and captures cloning decisions correctly.  I will take back my original comment on this one.

https://github.com/llvm/llvm-project/pull/67214


More information about the llvm-commits mailing list