summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyISD.def3
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp4
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td6
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td12
4 files changed, 17 insertions, 8 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISD.def b/llvm/lib/Target/WebAssembly/WebAssemblyISD.def
index 0bc9b2f55b1..24e613e7711 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISD.def
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISD.def
@@ -14,7 +14,8 @@
// NOTE: NO INCLUDE GUARD DESIRED!
-HANDLE_NODETYPE(CALL)
+HANDLE_NODETYPE(CALL1)
+HANDLE_NODETYPE(CALL0)
HANDLE_NODETYPE(RETURN)
HANDLE_NODETYPE(ARGUMENT)
HANDLE_NODETYPE(Wrapper)
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
index 7e9e1b0e016..12dce113c3e 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -261,7 +261,9 @@ WebAssemblyTargetLowering::LowerCall(CallLoweringInfo &CLI,
Tys.push_back(In.VT);
Tys.push_back(MVT::Other);
SDVTList TyList = DAG.getVTList(Tys);
- SDValue Res = DAG.getNode(WebAssemblyISD::CALL, DL, TyList, Ops);
+ SDValue Res =
+ DAG.getNode(Ins.empty() ? WebAssemblyISD::CALL0 : WebAssemblyISD::CALL1,
+ DL, TyList, Ops);
if (Ins.empty()) {
Chain = Res;
} else {
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
index abb7f21512a..d3430f225ee 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
@@ -23,14 +23,16 @@ def : I<(outs), (ins i64imm:$amt1, i64imm:$amt2),
multiclass CALL<WebAssemblyRegClass vt> {
def CALL_#vt : I<(outs vt:$dst), (ins Int32:$callee, variable_ops),
- [(set vt:$dst, (WebAssemblycall Int32:$callee))]>;
+ [(set vt:$dst, (WebAssemblycall1 Int32:$callee))]>;
}
let Uses = [SP32, SP64], isCall = 1 in {
defm : CALL<Int32>;
defm : CALL<Int64>;
defm : CALL<Float32>;
defm : CALL<Float64>;
- // FIXME: void.
+
+ def CALL_VOID : I<(outs), (ins Int32:$callee, variable_ops),
+ [(WebAssemblycall0 Int32:$callee)]>;
} // Uses = [SP32,SP64], isCall = 1
/*
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
index d73e66ea985..409c8525f93 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
@@ -28,7 +28,8 @@ def HasSIMD128 : Predicate<"Subtarget->hasSIMD128()">,
def SDT_WebAssemblyCallSeqStart : SDCallSeqStart<[SDTCisVT<0, iPTR>]>;
def SDT_WebAssemblyCallSeqEnd :
SDCallSeqEnd<[SDTCisVT<0, iPTR>, SDTCisVT<1, iPTR>]>;
-def SDT_WebAssemblyCall : SDTypeProfile<1, -1, [SDTCisPtrTy<1>]>;
+def SDT_WebAssemblyCall0 : SDTypeProfile<0, -1, [SDTCisPtrTy<0>]>;
+def SDT_WebAssemblyCall1 : SDTypeProfile<1, -1, [SDTCisPtrTy<1>]>;
def SDT_WebAssemblyArgument : SDTypeProfile<1, 1, [SDTCisVT<1, i32>]>;
def SDT_WebAssemblyReturn : SDTypeProfile<0, -1, []>;
def SDT_WebAssemblyWrapper : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>,
@@ -44,9 +45,12 @@ def WebAssemblycallseq_start :
def WebAssemblycallseq_end :
SDNode<"ISD::CALLSEQ_END", SDT_WebAssemblyCallSeqEnd,
[SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
-def WebAssemblycall : SDNode<"WebAssemblyISD::CALL",
- SDT_WebAssemblyCall,
- [SDNPHasChain, SDNPVariadic]>;
+def WebAssemblycall0 : SDNode<"WebAssemblyISD::CALL0",
+ SDT_WebAssemblyCall0,
+ [SDNPHasChain, SDNPVariadic]>;
+def WebAssemblycall1 : SDNode<"WebAssemblyISD::CALL1",
+ SDT_WebAssemblyCall1,
+ [SDNPHasChain, SDNPVariadic]>;
def WebAssemblyargument : SDNode<"WebAssemblyISD::ARGUMENT",
SDT_WebAssemblyArgument>;
def WebAssemblyreturn : SDNode<"WebAssemblyISD::RETURN",
OpenPOWER on IntegriCloud