[PATCH] D144274: [InstCombine] use loop info when running the pass after loop vectorization

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 3 12:43:48 PST 2023


spatel added a comment.

In D144274#4167818 <https://reviews.llvm.org/D144274#4167818>, @tschuett wrote:

> It is odd to me that instcombine has two modes: with and without loopinfo. Wouldn't completely removing loopinfo make instcombine better testable, hermetic, and predictable?

Yes, an option-free pass would be better in isolation, but we are trying to balance the goals of the pass and its effect on the entire `opt` pipeline.
Some notes to summarize how we got here and the expected path forward:

1. The GEP transform that currently uses LoopInfo probably doesn't even belong in InstCombine; it should be moved to LICM.
2. The fdiv transform from D144045 <https://reviews.llvm.org/D144045> is motivating this change. I'm proposing to allow LoopInfo to guide that fold (and likely others that are similar) because the main alternative so far is to add more passes to the pipeline to get the outcome we want. That's not good for compile-time.
3. Another alternative is to defer to codegen - that would either be CodeGenPrepare (because SDAG is limited to a single basic block) or GISel - but we would still be going back and forth on transforms, so it's not great for overall efficiency.
4. See D143631 <https://reviews.llvm.org/D143631> and D87479 <https://reviews.llvm.org/D87479> for previous discussion and details.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144274/new/

https://reviews.llvm.org/D144274



More information about the llvm-commits mailing list