[PATCH] D155888: [nfc] Renamed ICallPromotionFunc to InidrectCallPromoter

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 15:07:13 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9ef82be96eef: [nfc] Renamed ICallPromotionFunc to InidrectCallPromoter (authored by mtrofin).

Changed prior to commit:
  https://reviews.llvm.org/D155888?vs=542678&id=542698#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155888/new/

https://reviews.llvm.org/D155888

Files:
  llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp


Index: llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
+++ llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
@@ -104,9 +104,9 @@
 
 namespace {
 
-// The class for main data structure to promote indirect calls to conditional
-// direct calls.
-class ICallPromotionFunc {
+// Promote indirect calls to conditional direct calls, keeping track of
+// thresholds.
+class IndirectCallPromoter {
 private:
   Function &F;
 
@@ -142,11 +142,11 @@
                         uint64_t &TotalCount);
 
 public:
-  ICallPromotionFunc(Function &Func, InstrProfSymtab *Symtab, bool SamplePGO,
-                     OptimizationRemarkEmitter &ORE)
+  IndirectCallPromoter(Function &Func, InstrProfSymtab *Symtab, bool SamplePGO,
+                       OptimizationRemarkEmitter &ORE)
       : F(Func), Symtab(Symtab), SamplePGO(SamplePGO), ORE(ORE) {}
-  ICallPromotionFunc(const ICallPromotionFunc &) = delete;
-  ICallPromotionFunc &operator=(const ICallPromotionFunc &) = delete;
+  IndirectCallPromoter(const IndirectCallPromoter &) = delete;
+  IndirectCallPromoter &operator=(const IndirectCallPromoter &) = delete;
 
   bool processFunction(ProfileSummaryInfo *PSI);
 };
@@ -155,8 +155,8 @@
 
 // Indirect-call promotion heuristic. The direct targets are sorted based on
 // the count. Stop at the first target that is not promoted.
-std::vector<ICallPromotionFunc::PromotionCandidate>
-ICallPromotionFunc::getPromotionCandidatesForCallSite(
+std::vector<IndirectCallPromoter::PromotionCandidate>
+IndirectCallPromoter::getPromotionCandidatesForCallSite(
     const CallBase &CB, const ArrayRef<InstrProfValueData> &ValueDataRef,
     uint64_t TotalCount, uint32_t NumCandidates) {
   std::vector<PromotionCandidate> Ret;
@@ -275,7 +275,7 @@
 }
 
 // Promote indirect-call to conditional direct-call for one callsite.
-uint32_t ICallPromotionFunc::tryToPromote(
+uint32_t IndirectCallPromoter::tryToPromote(
     CallBase &CB, const std::vector<PromotionCandidate> &Candidates,
     uint64_t &TotalCount) {
   uint32_t NumPromoted = 0;
@@ -294,7 +294,7 @@
 
 // Traverse all the indirect-call callsite and get the value profile
 // annotation to perform indirect-call promotion.
-bool ICallPromotionFunc::processFunction(ProfileSummaryInfo *PSI) {
+bool IndirectCallPromoter::processFunction(ProfileSummaryInfo *PSI) {
   bool Changed = false;
   ICallPromotionAnalysis ICallAnalysis;
   for (auto *CB : findIndirectCalls(F)) {
@@ -344,8 +344,8 @@
         MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
     auto &ORE = FAM.getResult<OptimizationRemarkEmitterAnalysis>(F);
 
-    ICallPromotionFunc ICallPromotion(F, &Symtab, SamplePGO, ORE);
-    bool FuncChanged = ICallPromotion.processFunction(PSI);
+    IndirectCallPromoter CallPromoter(F, &Symtab, SamplePGO, ORE);
+    bool FuncChanged = CallPromoter.processFunction(PSI);
     if (ICPDUMPAFTER && FuncChanged) {
       LLVM_DEBUG(dbgs() << "\n== IR Dump After =="; F.print(dbgs()));
       LLVM_DEBUG(dbgs() << "\n");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155888.542698.patch
Type: text/x-patch
Size: 3150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230720/946bc4cf/attachment.bin>


More information about the llvm-commits mailing list