This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Added default stack-only instruction mode for MC.
ClosedPublic

Authored by aardappel on Jul 10 2018, 4:26 PM.

Details

Summary

Moved Explicit Locals pass to last.
Made that pass obligatory.
Made it convert from register to stack based instructions, and removed the registers.
Fixes to related code that was expecting register based instructions.
Added the correct testing flag to all tests, depending on what the
format they were expecting so far.
Translated one test to stack format as example: reg-stackify-stack.ll

tested:
llvm-lit -v find test -name WebAssembly
unittests/MC/*

Diff Detail

Repository
rL LLVM

Event Timeline

aardappel created this revision.Jul 10 2018, 4:26 PM

I kinda like the use of two separate testing mode flags, to avoid needing to refactor every test to the explicit local form right away.

test/CodeGen/WebAssembly/reg-stackify-stack.ll
5 ↗(On Diff #154901)

This is probably better merged with reg-stackify.ll, with two RUN commands and a --check-prefix arg passed to FileCheck. See test/CodeGen/WebAssembly/signext-inreg.ll for an example of the prefixing

16 ↗(On Diff #154901)

Probably worth the {{$}} on these two returns?

aheejin added inline comments.Jul 16 2018, 2:55 PM
test/CodeGen/WebAssembly/reg-stackify-stack.ll
16 ↗(On Diff #154901)

FileCheck has --match-full-lines option that forces to match full lines, so maybe we can use that instead for new tests..?

aheejin added inline comments.Jul 16 2018, 2:58 PM
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
130 ↗(On Diff #154901)

_S opcodes for atomic stores have been added in D48992.

aardappel marked 4 inline comments as done.Jul 23 2018, 1:31 PM
aardappel added inline comments.
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
130 ↗(On Diff #154901)

Thanks, rebased against that.

test/CodeGen/WebAssembly/reg-stackify-stack.ll
16 ↗(On Diff #154901)

Agreed, that would be simpler, especially since {{$}} is whitespace sensitive, and we have instructions that have whitespace in their output.

aardappel updated this revision to Diff 156866.Jul 23 2018, 1:32 PM
aardappel marked 2 inline comments as done.

Addressed code review, in particular merged two versions of reg-stackify.ll
into one.

This revision is now accepted and ready to land.Jul 27 2018, 1:22 PM
This revision was automatically updated to reflect the committed changes.