[WebAssembly] Use dominator information to improve BLOCK placement
authorDan Gohman <dan433584@gmail.com>
Mon, 23 Nov 2015 16:19:56 +0000 (16:19 +0000)
committerDan Gohman <dan433584@gmail.com>
Mon, 23 Nov 2015 16:19:56 +0000 (16:19 +0000)
commit96bd9462856432e699b649990237d8902b65bc7c
tree9e783bf3d5a9a2b0d9ef17a28ed18e9edc842cd8
parent8452e84d36329276ab755269896bd61bb994461e
[WebAssembly] Use dominator information to improve BLOCK placement

Always starting blocks at the top of their containing loops works, but creates
unnecessarily deep nesting because it makes all blocks in a loop overlap.
Refine the BLOCK placement algorithm to start blocks at nearest common
dominating points instead, which significantly shrinks them and reduces
overlapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253876 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
test/CodeGen/WebAssembly/cfg-stackify.ll