[flang-commits] [flang] [flang][mlir][fir] Unroll inner loops in presence of user vectorizati… (PR #210820)

Scott Manley via flang-commits flang-commits at lists.llvm.org
Thu Jul 23 07:00:03 PDT 2026


rscottmanley wrote:

> I am confused by this question, that is what this pass does. It marks the inner loops to be unrolled to allow the default vectorizor to work on said loop.

I am saying why not put unroll directives in the source code. Why are you relying on vector always to unroll child loops? That doesnt make sense as per the wording of the directive.

> Yes as the unroll happens in LoopFullUnrollPass which means it will already be unroller by the time it reaches LoopVectorize

What if the loop does not vectorize though? It's not just this loop, it's any loop nest with `vector always`. 

My issue is largely with overloading the meaning of `vector always`. If you want to adjust the wording to say that `vector always` will allow the compiler to do whatever is necessary to vectorize the loop that immediately follows the directive, then this PR is okay.

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


More information about the flang-commits mailing list