diff options
author | Dan Gohman <dan433584@gmail.com> | 2015-09-08 12:39:25 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2015-09-08 12:39:25 +0000 |
commit | 25d2a0dda42a86a82579a2ca4abc037ed2402eb8 (patch) | |
tree | 76a65f86ab4d2f37fbcf00963649197980d2c893 /llvm/lib | |
parent | 16bb65431cf35924594b37de5f6972052b8ade71 (diff) | |
download | bcm5719-llvm-25d2a0dda42a86a82579a2ca4abc037ed2402eb8.tar.gz bcm5719-llvm-25d2a0dda42a86a82579a2ca4abc037ed2402eb8.zip |
[WebAssembly] Enable SSA lowering and other pre-regalloc passes
llvm-svn: 247008
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp index 25fe846fc7f..4950e3bbea7 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -164,7 +164,27 @@ bool WebAssemblyPassConfig::addILPOpts() { return true; } void WebAssemblyPassConfig::addPreRegAlloc() {} -void WebAssemblyPassConfig::addRegAllocPasses(bool Optimized) {} +void WebAssemblyPassConfig::addRegAllocPasses(bool Optimized) { + // This is list is derived from the regalloc pass list used in + // addFastRegAlloc and addOptimizedRegAlloc in lib/CodeGen/Passes.cpp. We + // don't run the actual register allocator, but we do run the passes which + // lower SSA form, so after these passes are complete, we have non-SSA + // virtual registers. + + if (Optimized) { + addPass(&ProcessImplicitDefsID); + addPass(&LiveVariablesID); + addPass(&MachineLoopInfoID); + } + + addPass(&PHIEliminationID); + addPass(&TwoAddressInstructionPassID, false); + + if (Optimized) { + addPass(&RegisterCoalescerID); + addPass(&MachineSchedulerID); + } +} void WebAssemblyPassConfig::addPostRegAlloc() { // FIXME: the following passes dislike virtual registers. Disable them for now |