[PATCH] D115261: [LV] Disable runtime unrolling for vectorized loops.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 06:13:39 PDT 2022


fhahn added a comment.

In D115261#3760460 <https://reviews.llvm.org/D115261#3760460>, @dmgreen wrote:

> There is an example in https://godbolt.org/z/8YnsWfGGo where.. something is going wrong.

Yeah this is a case where the current logic to eliminate single-iteration vector loops doesn't trigger. Should be fixed by D133017 <https://reviews.llvm.org/D133017>

> This looks like it disabled full unrolling after vectorization too? I think it is fairly important for performance to be able to simplify loops away where the runtime trip count is small enough by unrolling them. Either where the loop count becomes constant propagated through LTO or the trip count is just low enough. As far as I understand straight line code will almost always be better that looping, and preventing full unrolling would lead to performance regressions.

The above patch doesn't solve the issue where the loop will need unrolling twice or more times to completely remove the loop overhead. This shouldn't be an issue for X86/most AArch64 cores and full unrolling leads to excessive unrolling as in https://github.com/llvm/llvm-project/issues/42332.  But it  may still be an issue for some other architectures. So maybe targets should be able to opt-in/out?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115261



More information about the llvm-commits mailing list