summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2017-02-27 22:38:58 +0000
committerDan Gohman <dan433584@gmail.com>2017-02-27 22:38:58 +0000
commitf52ee17a09eabe216562ef57115d8976b9d7f70e (patch)
tree46b42ff063a865164f78674660bf3b253d66f065 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
parent2d5841fa7334ac972fc89c12e60e17edf0612b1a (diff)
downloadbcm5719-llvm-f52ee17a09eabe216562ef57115d8976b9d7f70e.tar.gz
bcm5719-llvm-f52ee17a09eabe216562ef57115d8976b9d7f70e.zip
[WebAssembly] Split CFG-sorting into its own pass. NFC.
CFG sorting was already an independent algorithm from block/loop insertion; this change makes it more convenient to debug. llvm-svn: 296399
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
index 04bf7b118b7..44c794ef5da 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
@@ -280,7 +280,11 @@ void WebAssemblyPassConfig::addPreEmitPass() {
// Insert explicit get_local and set_local operators.
addPass(createWebAssemblyExplicitLocals());
- // Put the CFG in structured form; insert BLOCK and LOOP markers.
+ // Sort the blocks of the CFG into topological order, a prerequisite for
+ // BLOCK and LOOP markers.
+ addPass(createWebAssemblyCFGSort());
+
+ // Insert BLOCK and LOOP markers.
addPass(createWebAssemblyCFGStackify());
// Lower br_unless into br_if.
OpenPOWER on IntegriCloud