aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-09-16 16:51:30 +0000
committerDan Gohman <dan433584@gmail.com>2015-09-16 16:51:30 +0000
commit950a13cfa371503281f91eecdaac6286aca274f7 (patch)
tree577bee2ca86d87c3386463e8f163bbeb30885c46 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parentb02a320f5e141339b16348107f33a2bd5f40ad4d (diff)
downloadllvm-950a13cfa371503281f91eecdaac6286aca274f7.zip
llvm-950a13cfa371503281f91eecdaac6286aca274f7.tar.gz
llvm-950a13cfa371503281f91eecdaac6286aca274f7.tar.bz2
[WebAssembly] Check in an initial CFG Stackifier pass
This pass implements a simple algorithm for conversion from CFG to wasm's structured control flow. It doesn't yet handle multiple-entry loops; that will be added in a future patch. It also adds initial support for switch statements. Differential Revision: http://reviews.llvm.org/D12735 llvm-svn: 247818
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
index 60bb8eb..95cf008 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
@@ -159,8 +159,14 @@ void WebAssemblyPassConfig::addPostRegAlloc() {
disablePass(&PrologEpilogCodeInserterID);
// Fails with: should be run after register allocation.
disablePass(&MachineCopyPropagationID);
+
+ // TODO: Until we get ReverseBranchCondition support, MachineBlockPlacement
+ // can create ugly-looking control flow.
+ disablePass(&MachineBlockPlacementID);
}
void WebAssemblyPassConfig::addPreSched2() {}
-void WebAssemblyPassConfig::addPreEmitPass() {}
+void WebAssemblyPassConfig::addPreEmitPass() {
+ addPass(createWebAssemblyCFGStackify());
+}