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

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 09:30:11 PDT 2025


QuantumSegfault wrote:

The load in question is not a vector load. It's a scalar load of one of the elements the vector from the stack, created as the lowering of `extract_vector_elt`.

Folding `sext_in_reg` and `and` back into various loads could _probably_ done with tablegen, but is that much better? Defining a pattern for each combination of `(ext)load` + (`sext_in_reg` | `and`)?

It feels like we're missing something obvious here. Maybe the addrspace(1) load handling would be better suited elsewhere (other than ISelLowering)? Somewhere that won't interfere with these other optimizations???


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


More information about the llvm-commits mailing list