[llvm] [WebAssembly] Fix lowering of (extending) loads from addrspace(1) globals (PR #155937)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 8 09:40:22 PDT 2025


QuantumSegfault wrote:

I just looked into it. It's not that simple.

Currently LoadExtActions is a 2D (fixed sized) array mapping actions for each MVT -> MVT extending load pair. And since address spaces are 32-bit values, we can't just index into another fixed size dimension. That alone complicates things.

And how would a default value work anyway? Defaulting to address space 0 for checks wouldn't be quite right...the default addrspace parameter would need to somehow map correctly to an action that's an appropriate fallback/approximation of all the defined addrspace-specific actions. Or we create two separate APIs, one that is address space aware, and one that isn't.

-------

So far, GlobalISel (if it works out the way I hope) seems to be the saner option, considering it comes with address space understanding out of the box. It's been pretty intuitive so far, if a little tedious (working out the basics of the Legalizer right now).

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


More information about the llvm-commits mailing list