[llvm] [SHT_LLVM_BB_ADDR] Implement ELF and YAML support for Propeller CFG data in PGO analysis map. (PR #164914)

Rahman Lavaee via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 27 13:30:38 PDT 2025


================
@@ -1013,20 +1017,25 @@ struct PGOAnalysisMap {
       uint32_t ID;
       /// Branch Probability of the edge to this successor taken from MBPI.
       BranchProbability Prob;
+      /// Edge frequency from Propeller.
+      uint32_t PropellerFreq;
 
       bool operator==(const SuccessorEntry &Other) const {
-        return std::tie(ID, Prob) == std::tie(Other.ID, Other.Prob);
+        return std::tie(ID, Prob, PropellerFreq) ==
+               std::tie(Other.ID, Other.Prob, Other.PropellerFreq);
       }
     };
 
     /// Block frequency taken from MBFI
     BlockFrequency BlockFreq;
+    /// Block frequency taken from Propeller.
+    uint32_t PropellerBlockFreq;
----------------
rlavaee wrote:

Updated the comment.

> why uint32_t and not uint64_t?
Done.

The source of the data is [int32](https://github.com/google/llvm-propeller/blob/main/propeller/cfg_node.h#L72), but the compiler side is already reading [uint64_t](https://llvm.org/doxygen/structllvm_1_1FunctionPathAndClusterInfo.html#ae5fa66c53ae5675dca77123ba6638445). So it's better to use uint64_t as you suggested. 

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


More information about the llvm-commits mailing list