[llvm] 55a2473 - [CtxProf] Replace include with forward declaration (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 04:05:20 PDT 2024


Author: Nikita Popov
Date: 2024-09-04T13:05:09+02:00
New Revision: 55a24738302eb9bb5bf458220deb20ddef60ce51

URL: https://github.com/llvm/llvm-project/commit/55a24738302eb9bb5bf458220deb20ddef60ce51
DIFF: https://github.com/llvm/llvm-project/commit/55a24738302eb9bb5bf458220deb20ddef60ce51.diff

LOG: [CtxProf] Replace include with forward declaration (NFC)

This header is fairly expensive. Forward declare
PGOContextualProfile instead.

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/Utils/Cloning.h
    llvm/lib/Transforms/Utils/InlineFunction.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/Utils/Cloning.h b/llvm/include/llvm/Transforms/Utils/Cloning.h
index 2ddcfeb1501e28..a4be24e32c5279 100644
--- a/llvm/include/llvm/Transforms/Utils/Cloning.h
+++ b/llvm/include/llvm/Transforms/Utils/Cloning.h
@@ -20,7 +20,6 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Analysis/AssumptionCache.h"
-#include "llvm/Analysis/CtxProfAnalysis.h"
 #include "llvm/Analysis/InlineCost.h"
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/ValueHandle.h"
@@ -42,6 +41,7 @@ class Instruction;
 class Loop;
 class LoopInfo;
 class Module;
+class PGOContextualProfile;
 class ProfileSummaryInfo;
 class ReturnInst;
 class DomTreeUpdater;
@@ -276,7 +276,7 @@ InlineResult InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
 /// to the behavior of the non-contextual profile updating variant above. This
 /// makes it easy to drop-in replace uses of the non-contextual overload.
 InlineResult InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
-                            CtxProfAnalysis::Result &CtxProf,
+                            PGOContextualProfile &CtxProf,
                             bool MergeAttributes = false,
                             AAResults *CalleeAAR = nullptr,
                             bool InsertLifetime = true,

diff  --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 799ef3ab021d32..2e05fa80464b8d 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -2142,7 +2142,7 @@ inlineRetainOrClaimRVCalls(CallBase &CB, objcarc::ARCInstKind RVCallKind,
 // it's not worth updating those.
 static const std::pair<std::vector<int64_t>, std::vector<int64_t>>
 remapIndices(Function &Caller, BasicBlock *StartBB,
-             CtxProfAnalysis::Result &CtxProf, uint32_t CalleeCounters,
+             PGOContextualProfile &CtxProf, uint32_t CalleeCounters,
              uint32_t CalleeCallsites) {
   // We'll allocate a new ID to imported callsite counters and callsites. We're
   // using -1 to indicate a counter we delete. Most likely the entry ID, for
@@ -2258,7 +2258,7 @@ remapIndices(Function &Caller, BasicBlock *StartBB,
 // copying over the data of the callee, **intentionally without any value
 // scaling**, and copying over the callees of the inlined callee.
 llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
-                                        CtxProfAnalysis::Result &CtxProf,
+                                        PGOContextualProfile &CtxProf,
                                         bool MergeAttributes,
                                         AAResults *CalleeAAR,
                                         bool InsertLifetime,


        


More information about the llvm-commits mailing list