[PATCH] D158843: [ConstraintElim] Move just before loop simplification pipeline.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 19 04:12:31 PDT 2023
fhahn added a comment.
In D158843#4647355 <https://reviews.llvm.org/D158843#4647355>, @antoniofrighetto wrote:
> I can see how ConstraintElimination may benefit from dealing with regular compares, but wouldn't CE provide a more amenable IR for SimplifyCFG to work with? I just wonder whether we might risk to miss potential SimplifyCFG opportunities if we postpone this. Running InstCombine, AggressiveIC, and CE together early in the pipeline looks beneficial too for CFG simplification purposes, AFAICT.
I think CFG simplifications based on simplified conditions by ConstraintElimination should still happen before other optimizations; now we run the loop optimization pipeline `LPM1` directly after ConstraintElimination, which runs `LoopSimplifyCFG` early. This should take care of simplifying branches based on simplified conditions for loops, which is the scope the other passes in the pipeline operate on.
Straight after `LPM1`, we run `SimplifyCFGPass` again, which should simplify branches in non-loop blocks, before other optimizations.
In D158843#4647360 <https://reviews.llvm.org/D158843#4647360>, @antoniofrighetto wrote:
> To be clear: if the same previous opportunities would continue being caught by having SimplifyCFG run before, I see the rationale. Not sure if there's, e.g., some threshold on the number of cases to regular compares simplification for which that would not happen otherwise. Maybe would be nice to have some case that proves the benefit of this.
Yeah I had one somewhere. let me put one together.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158843/new/
https://reviews.llvm.org/D158843
More information about the llvm-commits
mailing list