[llvm] [PGO] Supporting code for always instrumenting loop entries (PR #116789)

Christian Ulmann via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 04:10:30 PST 2024


================
@@ -291,10 +299,12 @@ template <class Edge, class BBInfo> class CFGMST {
     return *AllEdges.back();
   }
 
-  CFGMST(Function &Func, bool InstrumentFuncEntry,
+  CFGMST(Function &Func, bool InstrumentFuncEntry, bool InstrumentLoopEntries,
          BranchProbabilityInfo *BPI = nullptr,
-         BlockFrequencyInfo *BFI = nullptr)
-      : F(Func), BPI(BPI), BFI(BFI), InstrumentFuncEntry(InstrumentFuncEntry) {
+         BlockFrequencyInfo *BFI = nullptr, LoopInfo *LI = nullptr)
+      : F(Func), BPI(BPI), BFI(BFI), LI(LI),
+        InstrumentFuncEntry(InstrumentFuncEntry),
+        InstrumentLoopEntries(InstrumentLoopEntries) {
----------------
Dinistro wrote:

Considering that `InstrumentLoopEntries` only makes sense together with a passed in `LoopInfo`, it might be reasonable to assert that they are passed together?

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


More information about the llvm-commits mailing list