summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-12-25 00:31:02 +0000
committerDan Gohman <dan433584@gmail.com>2015-12-25 00:31:02 +0000
commit8887d1faedb890defbeee4f849a6a9a22bda4af5 (patch)
tree9159cca49461127efe975f761adbaf3e9a225e0b /llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
parent99d235329f0e26bd0a3df51069b91e84289ca31b (diff)
downloadbcm5719-llvm-8887d1faedb890defbeee4f849a6a9a22bda4af5.tar.gz
bcm5719-llvm-8887d1faedb890defbeee4f849a6a9a22bda4af5.zip
[WebAssembly] Fix handling of COPY instructions in WebAssemblyRegStackify.
Move RegStackify after coalescing and teach it to use LiveIntervals instead of depending on SSA form. This avoids a problem where a register in a COPY instruction is stackified and then subsequently coalesced with a register that is not stackified. This also puts it after the scheduler, which allows us to simplify the EXPR_STACK constraint, as we no longer have instructions being reordered after stackification and before coloring. llvm-svn: 256402
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
index 9a9468bb390..05efe890341 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
@@ -50,9 +50,13 @@ def TABLESWITCH_I64 : I<(outs), (ins I64:$index, bb_op:$default, variable_ops),
"tableswitch\t$index, $default">;
} // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1
-// Placemarkers to indicate the start of a block or loop scope.
+// Placemarkers to indicate the start of a block or loop scope. These
+// use/clobber EXPR_STACK to prevent them from being moved into the middle of
+// an expression tree.
+let Uses = [EXPR_STACK], Defs = [EXPR_STACK] in {
def BLOCK : I<(outs), (ins bb_op:$dst), [], "block \t$dst">;
def LOOP : I<(outs), (ins bb_op:$dst), [], "loop \t$dst">;
+} // Uses = [EXPR_STACK], Defs = [EXPR_STACK]
// No-op to indicate to the AsmPrinter that a loop ends here, so a
// basic block label is needed even if it wouldn't otherwise appear so.
OpenPOWER on IntegriCloud