[llvm] [SCEVAA] Allowing to subtract two inttoptrs with different pointer bases (PR #91453)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 8 20:49:18 PDT 2024


csstormq wrote:

> See https://reviews.llvm.org/D104806 for why getMinusSCEV works this way. I would rather not relax the current restrictions.
> 
> What happens if you make SCEVAA explicitly PtrToInt the operands to the subtraction?

As you suggested, I have already tried the ptrtpoint pointer operands before calling getMinusSCEV(). `SCEVAAResult::alias()` returns `NoAlias` for my example. I am very glad about this result. But I'm not sure if this should always be done. Should an option be added to control whether it is turned on ?

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


More information about the llvm-commits mailing list