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

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/*

Reviewers: dschuff, sunfish

Subscribers: jfb, llvm-commits, aheejin, eraman, jgravelle-google, sbc100

Differential Revision: https://reviews.llvm.org/D50568

llvm-svn: 339474
This commit is contained in:
Wouter van Oortmerssen
2018-08-10 21:32:47 +00:00
parent 4b2e0b6c32
commit ab26bd0647
92 changed files with 852 additions and 426 deletions

View File

@@ -317,9 +317,6 @@ void WebAssemblyPassConfig::addPreEmitPass() {
// converted into a local.
addPass(createWebAssemblyFixIrreducibleControlFlow());
// Insert explicit get_local and set_local operators.
addPass(createWebAssemblyExplicitLocals());
// Do various transformations for exception handling
addPass(createWebAssemblyLateEHPrepare());
@@ -337,6 +334,9 @@ void WebAssemblyPassConfig::addPreEmitPass() {
if (getOptLevel() != CodeGenOpt::None)
addPass(createWebAssemblyPeephole());
// Insert explicit get_local and set_local operators.
addPass(createWebAssemblyExplicitLocals());
// Create a mapping from LLVM CodeGen virtual registers to wasm registers.
addPass(createWebAssemblyRegNumbering());
}