X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FTarget%2FWebAssembly%2FWebAssemblyTargetMachine.cpp;h=4c576ec647dfb2ebf0369cbefb82f95a56890e23;hp=5aae71084744b10fbeab020fcadf49959d113545;hb=94401ce9c85d7b09c8b31b967025c00f023bb3b3;hpb=fc0981ecbc83809ca8f2157fb7408150f63fa978 diff --git a/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp index 5aae7108474..4c576ec647d 100644 --- a/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ b/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -155,7 +155,10 @@ bool WebAssemblyPassConfig::addInstSelector() { bool WebAssemblyPassConfig::addILPOpts() { return true; } -void WebAssemblyPassConfig::addPreRegAlloc() {} +void WebAssemblyPassConfig::addPreRegAlloc() { + // Mark registers as representing wasm's expression stack. + addPass(createWebAssemblyRegStackify()); +} void WebAssemblyPassConfig::addPostRegAlloc() { // FIXME: the following passes dislike virtual registers. Disable them for now @@ -169,6 +172,9 @@ void WebAssemblyPassConfig::addPostRegAlloc() { // TODO: Until we get ReverseBranchCondition support, MachineBlockPlacement // can create ugly-looking control flow. disablePass(&MachineBlockPlacementID); + + // Run the register coloring pass to reduce the total number of registers. + addPass(createWebAssemblyRegColoring()); } void WebAssemblyPassConfig::addPreSched2() {}