LLVM: lib/Target/WebAssembly/WebAssemblyCFGSort.cpp File Reference (original) (raw)

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.

Sort the blocks, taking special care to make sure that regions are not interrupted by blocks not dominated by their header.

TODO: There are many opportunities for improving the heuristics here. Explore them.

Definition at line 185 of file WebAssemblyCFGSort.cpp.

References assert(), llvm::SetVector< T, Vector, Set, N >::back(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::RegionBase< Tr >::contains(), llvm::SetVector< T, Vector, Set, N >::count(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::MachineDominatorTree::dominates(), E(), llvm::SetVector< T, Vector, Set, N >::empty(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::MachineFunction::front(), llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor(), llvm::MachineFunction::getNumBlockIDs(), llvm::MachineFunction::getWasmEHFuncInfo(), llvm::SetVector< T, Vector, Set, N >::insert(), maybeUpdateTerminator(), MBB, N, llvm::Next, llvm::SetVector< T, Vector, Set, N >::pop_back(), llvm::SetVector< T, Vector, Set, N >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::MachineFunction::RenumberBlocks(), llvm::SetVector< T, Vector, Set, N >::size(), llvm::DominatorTreeBase< NodeT, IsPostDom >::updateBlockNumbers(), and WasmDisableEHPadSort.