[clang] [flang] [llvm] add -floop-fuse to clang and flang (PR #142686)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 02:46:19 PDT 2025


kasuga-fj wrote:

> What do you think is the right place in pass pipeline?

I don't know, but just a gut feeling, somewhere in `buildModuleOptimizationPipeline` looks reasonable to me rather than `buildFunctionSimplificationPipeline`. However, again, it should be determined by what you'd like to achieve with loop fusion.

FWIW: recently I moved the loop interchange pass from the simplification pipeline into the optimization pipeline in #145502. I did so more due to the drawbacks of having it in the simplification pipeline than any particular advantages of placing it in the optimization pipeline. I also confirmed that the number of interchanged loops barely changed after the move. However, I found that it triggered potential phase ordering issues after merging it (in my case, some other passes like GVN/LICM can transform the IR into a form that makes interchange difficult). I believe this should be handled inside LoopInterchange itself, but it's worth noting that (I think) it's not an uncommon situation.

(That said, if you don’t have any specific motivating examples at the moment, I suppose any placement would be fine).

https://github.com/llvm/llvm-project/pull/142686


More information about the llvm-commits mailing list