[llvm] [BasicAA] Use nuw attribute of GEPs (PR #98608)
Hari Limaye via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 13 07:02:09 PDT 2024
hazzlim wrote:
Hi @nikic
Thank you for pointing me in the right direction to make this work. I have pushed an updated implementation that drops the NUW flag in the cases you outlined.
>Swap LHS/RHS so that the larger GEP (in the number of variables) is on the left. I think doing this ahead of time is safer than trying to reason about IsNegated, because the IsNegated flag may get lost.
I had a look at doing this, but it seems like it would require changing a lot of code in `aliasGEP` to make this change work. Hopefully the approach I've taken here seems reasonable - as far as I understand it we should be okay to reason about `IsNegated || Scale.isNegative()` as the IsNegated flag is only lost when we are subtracting the Scale. However if you'd still prefer to Swap LHS/RHS I'd be happy to make that change.
https://github.com/llvm/llvm-project/pull/98608
More information about the llvm-commits
mailing list