From f52ee17a09eabe216562ef57115d8976b9d7f70e Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 27 Feb 2017 22:38:58 +0000 Subject: [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 --- llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp') 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. -- cgit v1.2.3