[llvm] r285016 - [WebAssembly] Define the `end` opcode value.

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 13:32:04 PDT 2016


Author: djg
Date: Mon Oct 24 15:32:04 2016
New Revision: 285016

URL: http://llvm.org/viewvc/llvm-project?rev=285016&view=rev
Log:
[WebAssembly] Define the `end` opcode value.

CFGStackify differentiates between END_LOOP and END_BLOCK, but wasm
itself doesn't. For now, just use the same opcode for both.

Modified:
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td?rev=285016&r1=285015&r2=285016&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td Mon Oct 24 15:32:04 2016
@@ -63,8 +63,10 @@ def BR_TABLE_I64 : I<(outs), (ins I64:$i
 let Uses = [VALUE_STACK], Defs = [VALUE_STACK] in {
 def BLOCK     : I<(outs), (ins Signature:$sig), [], "block   \t$sig", 0x02>;
 def LOOP      : I<(outs), (ins Signature:$sig), [], "loop    \t$sig", 0x03>;
-def END_BLOCK : I<(outs), (ins), [], "end_block">;
-def END_LOOP  : I<(outs), (ins), [], "end_loop">;
+
+// END_BLOCK and END_LOOP are represented with the same opcode in wasm.
+def END_BLOCK : I<(outs), (ins), [], "end_block", 0x0f>;
+def END_LOOP  : I<(outs), (ins), [], "end_loop", 0x0f>;
 } // Uses = [VALUE_STACK], Defs = [VALUE_STACK]
 
 multiclass RETURN<WebAssemblyRegClass vt> {




More information about the llvm-commits mailing list