[WebAssembly] Irreducible control flow rewrite
authorHeejin Ahn <aheejin@gmail.com>
Sat, 16 Mar 2019 03:00:19 +0000 (03:00 +0000)
committerHeejin Ahn <aheejin@gmail.com>
Sat, 16 Mar 2019 03:00:19 +0000 (03:00 +0000)
commita41250c7be565c12463942b572168baa06bc10b6
tree2aaee548a14dbf72df3554176b1db4bec6fdb160
parenta957f47e0a362d13fa947a1218315a0c46ab6db6
[WebAssembly] Irreducible control flow rewrite

Summary:
Rewrite WebAssemblyFixIrreducibleControlFlow to a simpler and cleaner
design, which directly computes reachability and other properties
itself. This avoids previous complexity and bugs. (The new graph
analyses are very similar to how the Relooper algorithm would find loop
entries and so forth.)

This fixes a few bugs, including where we had a false positive and
thought fannkuch was irreducible when it was not, which made us much
larger and slower there, and a reverse bug where we missed
irreducibility. On fannkuch, we used to be 44% slower than asm2wasm and
are now 4% faster.

Reviewers: aheejin

Subscribers: jdoerfert, mgrang, dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D58919

Patch by Alon Zakai (kripken)

llvm-svn: 356313
llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
llvm/test/CodeGen/WebAssembly/irreducible-cfg-nested.ll [deleted file]
llvm/test/CodeGen/WebAssembly/irreducible-cfg-nested2.ll [deleted file]
llvm/test/CodeGen/WebAssembly/irreducible-cfg.ll