[PATCH] D120365: [WebAssembly] Fixed AsmPrinter not emitting .functype for intrinsics

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 22 15:48:12 PST 2022


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

Intrinsics like `memset` were not emitted as `.functype` because
WebAssemblyAsmPrinter::emitExternalDecls explicitly skips symbols
that are isIntrinsic. Removing that check doesn't work, since the symbol
from the module refers to a 4-argument `llvm.memset.p0i8.i32` rather
than the 3-argument `memset` symbol referenced in the call.
Our `WebAssemblyMCLowerPrePass` however does collect the
`memset` symbol, so the current solution is as simple as emitting
`.functype` for those.

Fixes: https://github.com/llvm/llvm-project/issues/53712


https://reviews.llvm.org/D120365

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
  llvm/test/MC/WebAssembly/extern-functype-intrinsic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120365.410661.patch
Type: text/x-patch
Size: 5140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220222/23e0ecaf/attachment.bin>


More information about the llvm-commits mailing list