wasm64 was missing DAG ISEL patterns for external symbol based global.get, but simply adding these analogous to the existing 32-bit versions doesn't work.
This is because we are conflating the 32-bit global index with the pointer represented by the external symbol, which for wasm32 happened to work.
The simplest fix is to pretend we have a 64-bit global index. This sounds incorrect, but is immaterial since once this index is stored as a MachineOperand it becomes 64-bit anyway (and has been all along). As such, the EmitInstrWithCustomInserter based implementation I experimented with become a no-op and no further changes in the C++ code are required.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Very cool, I did not know any of these tricks were possible.
llvm/test/CodeGen/WebAssembly/load-store-pic.ll | ||
---|---|---|
4 | Nice! I didn't know you could define match strings from the command line like this. |
llvm/test/CodeGen/WebAssembly/load-store-pic.ll | ||
---|---|---|
4 | I didn't know either, but it was exactly what I needed, so I went to look in the docs for them :) The good thing about the LLVM eco-system is that whatever you're trying to do, someone has needed it before.. |
Nice! I didn't know you could define match strings from the command line like this.