[WebAssembly] Fix printing of global operands
[oota-llvm.git] / lib / Target / WebAssembly / WebAssemblyInstrInfo.td
index c4adeab4c6acd174a49f2c298ad08d47abc93825..9d59519822048dec39f8a74cdc7df0cff810f121 100644 (file)
@@ -106,10 +106,10 @@ def CONST_F64 : I<(outs F64:$res), (ins f64imm:$imm),
                   [(set F64:$res, fpimm:$imm)],
                   "f64.const\t$res, $imm">;
 
-// Special types of immediates. FIXME: Hard-coded as 32-bit for now.
-def GLOBAL : I<(outs I32:$dst), (ins global:$addr),
-               [(set I32:$dst, (WebAssemblywrapper tglobaladdr:$addr))],
-               "global\t$dst, $addr">;
+
+def : Pat<(i32 (WebAssemblywrapper tglobaladdr :$dst)),
+          (CONST_I32 tglobaladdr :$dst)>;
+
 def JUMP_TABLE : I<(outs I32:$dst), (ins tjumptable_op:$addr),
                    [(set I32:$dst, (WebAssemblywrapper tjumptable:$addr))],
                    "jump_table\t$dst, $addr">;