[PATCH] D138332: [Passes] Don't add CHR pass for CSIRInstr build in PostLink

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 15:07:32 PST 2022


xur created this revision.
xur added a reviewer: tejohnson.
Herald added a subscriber: hiraditya.
Herald added a project: All.
xur requested review of this revision.
Herald added a project: LLVM.

Don't add ControlHeightReductin (CHR) pass for CSIRInstr build in the PostLink because the profile is the same as the PreLink compilation.


https://reviews.llvm.org/D138332

Files:
  llvm/lib/Passes/PassBuilderPipelines.cpp


Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -603,8 +603,12 @@
   FPM.addPass(InstCombinePass());
   invokePeepholeEPCallbacks(FPM, Level);
 
+  // Don't add CHR pass for CSIRInstr build in PostLink as the profile
+  // is still the same as the PreLink compilation.
   if (EnableCHR && Level == OptimizationLevel::O3 && PGOOpt &&
-      (PGOOpt->Action == PGOOptions::IRUse ||
+      ((PGOOpt->Action == PGOOptions::IRUse &&
+        (Phase != ThinOrFullLTOPhase::ThinLTOPostLink ||
+         PGOOpt->CSAction != PGOOptions::CSIRInstr)) ||
        PGOOpt->Action == PGOOptions::SampleUse))
     FPM.addPass(ControlHeightReductionPass());
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138332.476609.patch
Type: text/x-patch
Size: 804 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221118/bcaf2158/attachment.bin>


More information about the llvm-commits mailing list