LLVM 22.0.0git
WebAssemblyCFGSort.cpp File Reference

This file implements a CFG sorting pass. More...

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "wasm-cfg-sort"

Functions

 INITIALIZE_PASS (WebAssemblyCFGSort, DEBUG_TYPE, "Reorders blocks in topological order", false, false) FunctionPass *llvm
static void maybeUpdateTerminator (MachineBasicBlock *MBB)
static void sortBlocks (MachineFunction &MF, const MachineLoopInfo &MLI, const WebAssemblyExceptionInfo &WEI, MachineDominatorTree &MDT)
 Sort the blocks, taking special care to make sure that regions are not interrupted by blocks not dominated by their header.

Variables

static cl::opt< boolWasmDisableEHPadSort ("wasm-disable-ehpad-sort", cl::ReallyHidden, cl::desc("WebAssembly: Disable EH pad-first sort order. Testing purpose only."), cl::init(false))

Detailed Description

This file implements a CFG sorting pass.

This pass reorders the blocks in a function to put them into topological order, ignoring loop backedges, and without any loop or exception being interrupted by a block not dominated by the its header, with special care to keep the order as similar as possible to the original order.

Definition in file WebAssemblyCFGSort.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "wasm-cfg-sort"

Definition at line 37 of file WebAssemblyCFGSort.cpp.

Function Documentation

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( WebAssemblyCFGSort ,
DEBUG_TYPE ,
"Reorders blocks in topological order" ,
false ,
false  )

Definition at line 72 of file WebAssemblyCFGSort.cpp.

References llvm::createWebAssemblyCFGSort(), and DEBUG_TYPE.

◆ maybeUpdateTerminator()

void maybeUpdateTerminator ( MachineBasicBlock * MBB)
static

◆ sortBlocks()

Variable Documentation

◆ WasmDisableEHPadSort

cl::opt< bool > WasmDisableEHPadSort("wasm-disable-ehpad-sort", cl::ReallyHidden, cl::desc( "WebAssembly: Disable EH pad-first sort order. Testing purpose only."), cl::init(false)) ( "wasm-disable-ehpad-sort" ,
cl::ReallyHidden ,
cl::desc( "WebAssembly: Disable EH pad-first sort order. Testing purpose only.") ,
cl::init(false)  )
static

Referenced by sortBlocks().