[PATCH] D138333: [CHR] Add a threshold for the code duplication

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 14:16:58 PST 2022


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.

This patch added a threshold to limit the duplication. We can discuss the
CHR on passmanager in this patch:  https://reviews.llvm.org/D138332.

-Rong

On Wed, Dec 7, 2022 at 11:38 AM Arthur Eubanks via Phabricator <
reviews at reviews.llvm.org> wrote:

> aeubanks added inline comments.
>
>
> ================
> Comment at: llvm/lib/Passes/PassBuilderPipelines.cpp:685
>         PGOOpt->Action == PGOOptions::SampleUse))
>      FPM.addPass(ControlHeightReductionPass());
>
> ----------------
> 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.
>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D138333/new/
>
> https://reviews.llvm.org/D138333
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221207/ef5a6f8b/attachment.html>


More information about the llvm-commits mailing list