git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247158
91177308-0d34-0410-b5e6-
96231b3b80d8
// NOTE: NO INCLUDE GUARD DESIRED!
// NOTE: NO INCLUDE GUARD DESIRED!
+HANDLE_NODETYPE(CALL1)
+HANDLE_NODETYPE(CALL0)
HANDLE_NODETYPE(RETURN)
HANDLE_NODETYPE(ARGUMENT)
HANDLE_NODETYPE(Wrapper)
HANDLE_NODETYPE(RETURN)
HANDLE_NODETYPE(ARGUMENT)
HANDLE_NODETYPE(Wrapper)
Tys.push_back(In.VT);
Tys.push_back(MVT::Other);
SDVTList TyList = DAG.getVTList(Tys);
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 {
if (Ins.empty()) {
Chain = Res;
} else {
multiclass CALL<WebAssemblyRegClass vt> {
def CALL_#vt : I<(outs vt:$dst), (ins Int32:$callee, variable_ops),
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>;
}
let Uses = [SP32, SP64], isCall = 1 in {
defm : CALL<Int32>;
defm : CALL<Int64>;
defm : CALL<Float32>;
defm : CALL<Float64>;
+
+ def CALL_VOID : I<(outs), (ins Int32:$callee, variable_ops),
+ [(WebAssemblycall0 Int32:$callee)]>;
} // Uses = [SP32,SP64], isCall = 1
/*
} // Uses = [SP32,SP64], isCall = 1
/*
def SDT_WebAssemblyCallSeqStart : SDCallSeqStart<[SDTCisVT<0, iPTR>]>;
def SDT_WebAssemblyCallSeqEnd :
SDCallSeqEnd<[SDTCisVT<0, iPTR>, SDTCisVT<1, iPTR>]>;
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>,
def SDT_WebAssemblyArgument : SDTypeProfile<1, 1, [SDTCisVT<1, i32>]>;
def SDT_WebAssemblyReturn : SDTypeProfile<0, -1, []>;
def SDT_WebAssemblyWrapper : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>,
def WebAssemblycallseq_end :
SDNode<"ISD::CALLSEQ_END", SDT_WebAssemblyCallSeqEnd,
[SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
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",
def WebAssemblyargument : SDNode<"WebAssemblyISD::ARGUMENT",
SDT_WebAssemblyArgument>;
def WebAssemblyreturn : SDNode<"WebAssemblyISD::RETURN",
declare i64 @i64_nullary()
declare float @float_nullary()
declare double @double_nullary()
declare i64 @i64_nullary()
declare float @float_nullary()
declare double @double_nullary()
+declare void @void_nullary()
; CHECK-LABEL: (func $call_i32_nullary
; CHECK-NEXT: (result i32)
; CHECK-LABEL: (func $call_i32_nullary
; CHECK-NEXT: (result i32)
+; CHECK-LABEL: (func $call_void_nullary
+; CHECK-NEXT: (setlocal @0 (global $void_nullary))
+; CHECK-NEXT: (call @0)
+; CHECK-NEXT: (return)
+define void @call_void_nullary() {
+ call void @void_nullary()
+ ret void
+}
+
; CHECK-LABEL: (func $call_i32_unary
; CHECK-NEXT: (param i32) (result i32)
; CHECK-NEXT: (setlocal @0 (argument 0))
; CHECK-LABEL: (func $call_i32_unary
; CHECK-NEXT: (param i32) (result i32)
; CHECK-NEXT: (setlocal @0 (argument 0))