[llvm] [GlobalISel] Enhance iPTR type support in SDAG patterns (PR #111503)

Evgenii Kudriashov via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 28 06:22:27 PST 2024


e-kud wrote:

> This is just a bug, the vector index type is separate from the pointer type

We can't simply change the constrain in general
```
def SDTVecInsert : SDTypeProfile<1, 3, [    // vector insert
  SDTCisEltOfVec<2, 1>, SDTCisSameAs<0, 1>, SDTCisPtrTy<3>
]>;
```
Most of the target have already accepted idea of `iPTR` index.  To fix the bug, all targets should be fixed first.

Then I tried to change the element type to i32 only on X86 (we need some common type for 32bit and 64bit platforms). It caused a lot of regressions since we have some combines that assume only for `i64` indices. Some of them are easy to fix, some of them aren't as different combines become active.

I'll try to solve them one by one before migrating to i32 index type. If anyone has better ideas on how to proceed, I'd appreciate it. Closing for now, as migration to `i32` seems feasible.  

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


More information about the llvm-commits mailing list