[WebAssembly] Implement ReverseBranchCondition, and re-enable MachineBlockPlacement
authorDan Gohman <dan433584@gmail.com>
Sat, 5 Dec 2015 03:03:35 +0000 (03:03 +0000)
committerDan Gohman <dan433584@gmail.com>
Sat, 5 Dec 2015 03:03:35 +0000 (03:03 +0000)
commit8893466777ecbe91ff69206072bc95a3e38e1a0d
treeef48cce5e834ed506a1f59513586f4fc769f95f7
parent35be75843e0a6e2b7f6431b7d960379380aa345d
[WebAssembly] Implement ReverseBranchCondition, and re-enable MachineBlockPlacement

This patch introduces a codegen-only instruction currently named br_unless,
which makes it convenient to implement ReverseBranchCondition and re-enable
the MachineBlockPlacement pass. Then in a late pass, it lowers br_unless
back into br_if.

Differential Revision: http://reviews.llvm.org/D14995

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254826 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/CMakeLists.txt
lib/Target/WebAssembly/WebAssembly.h
lib/Target/WebAssembly/WebAssemblyInstrControl.td
lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp [new file with mode: 0644]
lib/Target/WebAssembly/WebAssemblyPeephole.cpp
lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
test/CodeGen/WebAssembly/cfg-stackify.ll
test/CodeGen/WebAssembly/reg-stackify.ll
test/CodeGen/WebAssembly/switch.ll