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());