[PATCH] D118995: [WebAssembly] Refactor and fix emission of external IR global decls

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 4 06:59:08 PST 2022


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

Reland of 00bf4755 <https://reviews.llvm.org/rG00bf4755e90c89963a135739218ef49c2417109f>.

This patches fixes the visibility and linkage information of symbols
referring to IR globals.

Emission of external declarations is now done in the first execution
of emitConstantPool rather than in emitLinkage (and a few other
places). This is the point where we have already gathered information
about used symbols (by running the MC Lower PrePass) and not yet
started emitting any functions so that any declarations that need to
be emitted are done so at the top of the file before any functions.

This changes the order of a few directives in the final asm file which
required an update to a few tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118995

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.h
  llvm/lib/Target/WebAssembly/WebAssemblyMCLowerPrePass.cpp
  llvm/test/CodeGen/WebAssembly/externref-tableget.ll
  llvm/test/CodeGen/WebAssembly/externref-tableset.ll
  llvm/test/CodeGen/WebAssembly/funcref-table_call.ll
  llvm/test/CodeGen/WebAssembly/funcref-tableget.ll
  llvm/test/CodeGen/WebAssembly/funcref-tableset.ll
  llvm/test/CodeGen/WebAssembly/global-get.ll
  llvm/test/CodeGen/WebAssembly/global-set.ll
  llvm/test/CodeGen/WebAssembly/hidden-decl.ll
  llvm/test/CodeGen/WebAssembly/table-types.ll
  llvm/test/MC/WebAssembly/assembler-binary.ll
  llvm/test/MC/WebAssembly/stack-ptr-mclower.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118995.405955.patch
Type: text/x-patch
Size: 15892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220204/89d5d618/attachment.bin>


More information about the llvm-commits mailing list