[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 14:34:08 PDT 2023


================
@@ -28,17 +28,60 @@
 
 namespace llvm {
 
-// The cluster information for a machine basic block.
-struct BBClusterInfo {
-  // Unique ID for this basic block.
+// This structure represents a unique ID for every block specified in the
+// input profile.
+struct ProfileBBID {
+  // Basic block id associated with `MachineBasicBlock::BBID`.
   unsigned BBID;
+  // The clone id associated with the block. This is zero for the original
+  // block. For the cloned ones, it is equal to 1 + index of the associated
+  // path in `RawFunctionProfile::ClonePaths`.
+  unsigned CloneID;
+};
+
+// This struct represents the cluster information for a machine basic block,
+// which is specifed by a unique ID. This templated struct is used for both the
+// raw input profile (as `BBProfle<ProfileBBID>`) and the processed profile
+// after applying the clonings (as `BBProfile<unsigned>`).
+template <typename BBIDType> struct BBProfile {
----------------
tmsri wrote:

BBProfile does not seem like an apt name for this structure as it does not contain any profile information?  I see that this is essentially BBClusterInfo, with the exception that there would be a cloneID for blocks from the input profile, maybe rename?

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


More information about the llvm-commits mailing list