[PATCH] D99904: [WebAssembly] Fix for PIC external symbol ISEL

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 5 16:06:18 PDT 2021


aardappel created this revision.
aardappel added reviewers: sbc100, tlively, dschuff.
Herald added subscribers: ecnelises, sunfish, hiraditya, jgravelle-google.
aardappel requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D99904

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
  llvm/test/CodeGen/WebAssembly/load-store-pic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99904.335351.patch
Type: text/x-patch
Size: 8789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210405/4661bf02/attachment.bin>


More information about the llvm-commits mailing list