X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FTarget%2FWebAssembly%2FWebAssemblyTargetMachine.cpp;h=b290b4bf7440e6107266f8a156191258e84b97a0;hp=c33c21fe68566a067a67d4805285abf1714e8008;hb=e410c02857a0d27c0877ee2ab36d7b9d3f7ed0e6;hpb=6b90fe4207bcd41cd7527fec66235c6c7c8cbc07 diff --git a/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp index c33c21fe685..b290b4bf744 100644 --- a/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ b/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -20,7 +20,6 @@ #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/RegAllocRegistry.h" -#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" #include "llvm/IR/Function.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/TargetRegistry.h" @@ -46,8 +45,9 @@ WebAssemblyTargetMachine::WebAssemblyTargetMachine( const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL) - : LLVMTargetMachine(T, TT.isArch64Bit() ? "e-p:64:64-i64:64-n32:64-S128" - : "e-p:32:32-i64:64-n32:64-S128", + : LLVMTargetMachine(T, + TT.isArch64Bit() ? "e-m:e-p:64:64-i64:64-n32:64-S128" + : "e-m:e-p:32:32-i64:64-n32:64-S128", TT, CPU, FS, Options, RM, CM, OL), TLOF(make_unique()) { // WebAssembly type-checks expressions, but a noreturn function with a return @@ -166,12 +166,6 @@ void WebAssemblyPassConfig::addPreRegAlloc() { // Prepare store instructions for register stackifying. addPass(createWebAssemblyStoreResults()); - - // Mark registers as representing wasm's expression stack. - addPass(createWebAssemblyRegStackify()); - // The register coalescing pass has a bad interaction with COPY MIs which have - // EXPR_STACK as an extra operand - //disablePass(&RegisterCoalescerID); } void WebAssemblyPassConfig::addPostRegAlloc() { @@ -185,6 +179,9 @@ void WebAssemblyPassConfig::addPostRegAlloc() { // Fails with: should be run after register allocation. disablePass(&MachineCopyPropagationID); + // Mark registers as representing wasm's expression stack. + addPass(createWebAssemblyRegStackify()); + // Run the register coloring pass to reduce the total number of registers. addPass(createWebAssemblyRegColoring()); @@ -198,7 +195,7 @@ void WebAssemblyPassConfig::addPostRegAlloc() { void WebAssemblyPassConfig::addPreEmitPass() { TargetPassConfig::addPreEmitPass(); - + // Put the CFG in structured form; insert BLOCK and LOOP markers. addPass(createWebAssemblyCFGStackify());