[WebAssembly] MC: Fix for data aliases with offsets (getelementptr)
authorSam Clegg <sbc@chromium.org>
Wed, 29 Apr 2020 22:38:11 +0000 (15:38 -0700)
committerSam Clegg <sbc@chromium.org>
Wed, 17 Jun 2020 23:25:50 +0000 (16:25 -0700)
commit7ee758d691b2afc2f130ba3a8f8507fb6415f1d9
tree2ec145509f01d2033a19ec05a8f6ad96c53e1022
parent6c4ce202267ee089e611b7bee1dc4f3eb07ba23d
[WebAssembly] MC: Fix for data aliases with offsets (getelementptr)

For some reason we hadn't seen such cases in the wild which makes
me think that clang and rustc don't generate these.  In the bug which
reproduces it only occurs with LTO so my guess is that some LTO pass
is creating this alias + gep.

See: https://github.com/emscripten-core/emscripten/issues/8731

Differential Revision: https://reviews.llvm.org/D79462
llvm/lib/MC/WasmObjectWriter.cpp
llvm/test/CodeGen/WebAssembly/aliases.ll [new file with mode: 0644]
llvm/test/MC/WebAssembly/alias.s [new file with mode: 0644]
llvm/test/MC/WebAssembly/offset.s [new file with mode: 0644]