[llvm] [LoopVectorize] Enable hoisting of runtime checks by default (PR #71538)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 23 05:29:36 PST 2023


fhahn wrote:

> Hmm, I guess the trick is to do this in a way that doesn't make x264 slower because I know one of the loops in x264 that benefits from this do have lightweight diff-checks. Even diff checks are still expensive for short inner loops. Do you know of any specific benchmarks where this is a problem? Is
> 
> https://github.com/llvm/llvm-project/blob/fd9a777e018d23d258646af613179eebf6df4b34/llvm/test/Transforms/LoopVectorize/runtime-checks-difference.ll#L279
> 
> the most definitive example of benchmarks you're worried will get slower?

For cases like this one (where the start of the inner AddRecs is the same outer loop AddRec), the difference should also become loop invariant, as the diff checks subtract the starts, so if the outer AddRecs are the same this simplifies to the start of the outer AddRec, which is invariant.

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


More information about the llvm-commits mailing list