[llvm] Support vector `ptrtoint` and `inttoptr` with X86 GlobalISel. (PR #175270)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 31 05:45:46 PST 2026
================
@@ -324,10 +324,15 @@ X86LegalizerInfo::X86LegalizerInfo(const X86Subtarget &STI,
getActionDefinitionsBuilder(G_PTRTOINT)
.legalForCartesianProduct(Is64Bit ? PtrTypes64 : PtrTypes32, {p0})
+ .legalFor(HasSSE2, {{Is64Bit ? v2s64 : v4s32}, {Is64Bit ? v2p0 : v4p0}})
+ .legalFor(HasAVX && Is64Bit, {{v4s64}, {v4p0}})
.maxScalar(0, sMaxScalar)
.widenScalarToNextPow2(0, /*Min*/ 8);
- getActionDefinitionsBuilder(G_INTTOPTR).legalFor({{p0, sMaxScalar}});
+ getActionDefinitionsBuilder(G_INTTOPTR)
+ .legalFor({{p0, sMaxScalar}})
+ .legalFor(HasSSE2, {{Is64Bit ? v2p0 : v4p0}, {Is64Bit ? v2s64 : v4s32}})
+ .legalFor(HasAVX && Is64Bit, {{v4p0}, {v4s64}});
----------------
RKSimon wrote:
Every AVX or AVX-512 capable CPU is capable of running in 32-bit mode - and there's still plenty of people who still need to do this - welcome to x86 :)
https://github.com/llvm/llvm-project/pull/175270
More information about the llvm-commits
mailing list