[llvm] [InstCombine] Canonicalise SextADD + GEP (PR #69581)

Bruno De Fraine via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 03:43:16 PDT 2024


brunodf-snps wrote:

@nikic Thanks for the clarification. If I first perform loop rotation (https://gist.github.com/brunodf-snps/4a045f596a4c568fdeda86f691d9d118), I indeed see that inbounds is retained when instcombine rewrites the gep.

> Worth noting that since https://github.com/llvm/llvm-project/pull/78576 LoopFlatten will still apply without inbounds via loop versioning, so this is not a question of whether flattening occurs, just of whether it requires versioning or not.

Thanks for pointing this out. The loop versioning was added after LLVM 18 (see https://godbolt.org/z/xdYdYs3nn) so I had not noticed it yet.

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


More information about the llvm-commits mailing list