[WebAssembly] Codegen support for ISD::ExternalSymbol
[oota-llvm.git] / lib / Target / WebAssembly / WebAssemblyInstrInfo.td
index 5922f95f03992b197409761afa6026d2d1df781f..e9a16cec33a8b17151d1ef81628ddd1b39391992 100644 (file)
@@ -125,8 +125,10 @@ def CONST_F64 : I<(outs F64:$res), (ins f64imm:$imm),
                   [(set F64:$res, fpimm:$imm)],
                   "f64.const\t$res, $imm">;
 
-def : Pat<(i32 (WebAssemblywrapper tglobaladdr :$dst)),
-          (CONST_I32 tglobaladdr :$dst)>;
+def : Pat<(i32 (WebAssemblywrapper tglobaladdr:$dst)),
+          (CONST_I32 tglobaladdr:$dst)>;
+def : Pat<(i32 (WebAssemblywrapper texternalsym:$dst)),
+          (CONST_I32 texternalsym:$dst)>;
 
 def JUMP_TABLE : I<(outs I32:$dst), (ins tjumptable_op:$addr),
                    [(set I32:$dst, (WebAssemblywrapper tjumptable:$addr))],