This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Make disassembler always emit most canonical name.
ClosedPublic

Authored by aardappel on Feb 4 2019, 2:15 PM.

Details

Summary

There are a few instructions that all map to the same opcode, so
when disassembling, we have to pick one. That was just the first one
before (the except_ref variant in the case of "call"), now it is the
one marked as IsCanonical in tablegen, or failing that, the shortest
name (which is typically the "canonical" one).

Also introduced a canonical "end" instruction for this purpose.

Diff Detail

Repository
rL LLVM

Event Timeline

aardappel created this revision.Feb 4 2019, 2:15 PM
sbc100 accepted this revision.Feb 4 2019, 2:19 PM

I'm probably not qualified to review the tablegen stuff, but seems like a nice solution.

This revision is now accepted and ready to land.Feb 4 2019, 2:19 PM
tlively accepted this revision.Feb 4 2019, 2:22 PM

Looks great! Thanks!

aheejin added inline comments.Feb 4 2019, 2:24 PM
lib/Target/WebAssembly/WebAssemblyInstrCall.td
96 ↗(On Diff #185158)

I don't think we indent within a let block in .td files. But I also see we do in some parts in this WebAssemblyInstrCall.td.. How about making a separate CL that disables all indentation within let blocks and making that this CL dependent on that CL? For other .td files as well.

dschuff added inline comments.Feb 4 2019, 2:30 PM
test/MC/Disassembler/WebAssembly/wasm.txt
36 ↗(On Diff #185158)

should this comment be updated now?

aardappel marked 3 inline comments as done.Feb 4 2019, 5:14 PM
aardappel added inline comments.
lib/Target/WebAssembly/WebAssemblyInstrCall.td
96 ↗(On Diff #185158)

There appears to be a mix of these, but not indenting is more common. So for now I'll just not indent my new code.

aardappel updated this revision to Diff 185197.Feb 4 2019, 5:15 PM
aardappel marked an inline comment as done.

Code review fixes.

This revision was automatically updated to reflect the committed changes.