[llvm] [WebAssembly] Implement GlobalISel (PR #157161)
Demetrius Kanios via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 2 00:30:24 PDT 2025
QuantumSegfault wrote:
@dschuff
I'm getting close to having a MVP for you to review. But in the meanwhile, I have a question (if you don't know, maybe you'll at least know who does).
I'm working on the instruction selection phase currently. The compatibility layer works pretty well for importing the existing (SelectionDAG) tblgen patterns to work with GISel. So far one of the biggest issues is that my p0 (LLT; pointers in address space 0) aren't getting matched existing patterns expecting an i32/i64 (LLT s32 or s64?). For instance, G_CONSTANT matches to CONST_I32/CONST_I64 when giving a constant s32 or s64, but fails when providing a p0 (e.g. 0 to represent null pointer).
What's the best way to fix this. Do I just have to manually implement `select` for such operations, or is there a way to tell SelectionDAGCompat to treat p0 as either i32/s32 or i64/s64 depending on the current address size?
Note that regbankselect is already putting them in i32regbank or i64regbank as appropriate, so that's working. Its just isel that isn't matching them.
https://github.com/llvm/llvm-project/pull/157161
More information about the llvm-commits
mailing list