[llvm] Support vector `ptrtoint` and `inttoptr` with X86 GlobalISel. (PR #175270)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 30 10:39:53 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}});
----------------
YohayAiTe wrote:
I didn't add it because as far as I know there are no 32-bit CPUs with AVX/AVX-512 support, but I guess this doesn't mean the compiler can't support it.
https://github.com/llvm/llvm-project/pull/175270
More information about the llvm-commits
mailing list