[PATCH] D143460: [CSPGO][CHR] Disable CHR in ThinLTOPostLink mode

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 20:34:25 PST 2023


xur created this revision.
xur added a reviewer: davidxl.
Herald added subscribers: wenlei, hiraditya, inglorion.
Herald added a project: All.
xur requested review of this revision.
Herald added a project: LLVM.

Disable CHR in ThinLTOPostLink pipeline. In the previous commit 6327d263f5e2a <https://reviews.llvm.org/rG6327d263f5e2a18645979fac2525b574866adbe5>: [CHR] Add a threshold for the code duplication,
I disabled CHR for CSIRInstr in ThinLTOPostLink. That change creates profile mismatch issues in CSFDO profile use compilation.

Here I disable CHR for ThinLTOPostLink. We have an earlier round of CHR and I don't think we need this round CHR here.

I think the better place for CHR would be in ModuleOptimization pipeline after CSFDO because CHR is an expensive optimization. I will have a follow-up patch for that after some performance test.


https://reviews.llvm.org/D143460

Files:
  llvm/lib/Passes/PassBuilderPipelines.cpp


Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -684,12 +684,11 @@
   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.
+  // Don't add CHR pass for ThinLTOPostLink compiliation as the
+  // profile is still the same as the PreLink compilation.
   if (EnableCHR && Level == OptimizationLevel::O3 && PGOOpt &&
       ((PGOOpt->Action == PGOOptions::IRUse &&
-        (Phase != ThinOrFullLTOPhase::ThinLTOPostLink ||
-         PGOOpt->CSAction != PGOOptions::CSIRInstr)) ||
+        Phase != ThinOrFullLTOPhase::ThinLTOPostLink) ||
        PGOOpt->Action == PGOOptions::SampleUse))
     FPM.addPass(ControlHeightReductionPass());
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143460.495366.patch
Type: text/x-patch
Size: 941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230207/667f6fda/attachment.bin>


More information about the llvm-commits mailing list