[llvm] [GlobalISel] Constant-fold G_PTR_ADD with different type sizes (PR #81473)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 04:46:03 PST 2024


Pierre-vh wrote:

> I am not yet convinced.
> 
> ```
> G_PTR_ADD p8 %5, s32 %6
> ```
> 
> The pointer and the offset have different types and probably different sizes. p8 could be some weird 128bit pointer in address space 8.

What do you mean? This handles both cases when C1 > C2 and C2 > C1, tests now covers both issues as well.

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


More information about the llvm-commits mailing list