[WebAssembly] Fix dominance check for PHIs in the StoreResult pass
authorDan Gohman <dan433584@gmail.com>
Thu, 3 Dec 2015 23:07:03 +0000 (23:07 +0000)
committerDan Gohman <dan433584@gmail.com>
Thu, 3 Dec 2015 23:07:03 +0000 (23:07 +0000)
commite94b2105e93b551b1b1bc9a009eb7c3c622ad5b7
tree2d3c32fd925f128112d2de7001f586050e427a32
parentadd5c9809ba804ed03c7f289a29fccb158d27ae9
[WebAssembly] Fix dominance check for PHIs in the StoreResult pass

When a block has no terminator instructions, getFirstTerminator() returns
end(), which can't be used in dominance checks. Check dominance for phi
operands separately.

Also, remove some bits from WebAssemblyRegStackify.cpp that were causing
trouble on the same testcase; they were left behind from an earlier
experiment.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254662 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
lib/Target/WebAssembly/WebAssemblyStoreResults.cpp
test/CodeGen/WebAssembly/store-results.ll