This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Replace all calls with generalized multivalue calls
ClosedPublic

Authored by tlively on Feb 6 2020, 8:47 PM.

Details

Summary

Extends the multivalue call infrastructure to tail calls, removes all
legacy calls specialized for particular result types, and removes the
CallIndirectFixup pass, since all indirect call arguments are now
fixed up directly in the post-insertion hook.

In order to keep supporting pretty-printed defs and uses in test
expectations, MCInstLower now inserts an immediate containing the
number of defs for each call and call_indirect. The InstPrinter is
updated to query this immediate if it is present and determine which
MCOperands are defs and uses accordingly.

Depends on D72902.

Diff Detail

Event Timeline

tlively created this revision.Feb 6 2020, 8:47 PM
Herald added a project: Restricted Project. ยท View Herald TranscriptFeb 6 2020, 8:47 PM
tlively updated this revision to Diff 243074.Feb 6 2020, 8:50 PM
  • Resolve small TODO

I want to go through this and fix obvious white space errors in the tests, but the code should be good to go.

tlively updated this revision to Diff 243281.Feb 7 2020, 1:55 PM
  • Update whitespace in tests

The Emscripten test suite passes with this change as well.

This comment was removed by aheejin.
aheejin accepted this revision.Feb 14 2020, 6:03 PM

Yay! ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰ It's very simpler and nicer this way.

llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp
80

Can we add a test that prints multivalue calls w/ -wasm-keep-registers and -wasm-explicit-locals on? I don't think this part is being tested for multivalue calls.

llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
70

Why usesCustomInserter for RET_CALL_INDIRECT?

This revision is now accepted and ready to land.Feb 14 2020, 6:03 PM
tlively marked 2 inline comments as done.Feb 18 2020, 3:20 PM
tlively added inline comments.
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp
80

Sure, will add a new test mode to multivalue.ll.

llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
70

Good catch. This is unnecessary.

This revision was automatically updated to reflect the committed changes.
llvm/lib/Target/WebAssembly/WebAssembly.h