<div dir="ltr"><div>I kind of agree on your point. I also think ModuleOPtimization pipeline fits better for this pass. This pass is very aggressive in terms of control flow. In my cases it duplicated the whole function.<br></div><div><br></div><div>This patch added a threshold to limit the duplication. We can discuss the CHR on passmanager in this patch:  <a href="https://reviews.llvm.org/D138332">https://reviews.llvm.org/D138332</a>.</div><div><br></div><div>-Rong</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 7, 2022 at 11:38 AM Arthur Eubanks via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">aeubanks added inline comments.<br>
<br>
<br>
================<br>
Comment at: llvm/lib/Passes/PassBuilderPipelines.cpp:685<br>
        PGOOpt->Action == PGOOptions::SampleUse))<br>
     FPM.addPass(ControlHeightReductionPass());<br>
<br>
----------------<br>
I've had the thought in the past, shouldn't this go in the optimization pipeline (`buildModuleOptimizationPipeline`) rather than simplification pipeline (`buildModuleSimplificationPipeline`)? CHR definitely isn't a simplification. And that would make the check for ThinLTO phase go away since it'd only happen in the backend compile.<br>
<br>
<br>
Repository:<br>
  rG LLVM Github Monorepo<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D138333/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D138333/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D138333" rel="noreferrer" target="_blank">https://reviews.llvm.org/D138333</a><br>
<br>
</blockquote></div></div>