[PATCH] D11692: WebAssembly: handle `ret void`.
JF Bastien
jfb at chromium.org
Fri Jul 31 14:04:57 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL243783: WebAssembly: handle `ret void`. (authored by jfb).
Changed prior to commit:
http://reviews.llvm.org/D11692?vs=31158&id=31163#toc
Repository:
rL LLVM
http://reviews.llvm.org/D11692
Files:
llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td
llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
llvm/trunk/test/CodeGen/WebAssembly/return-void.ll
Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -146,8 +146,7 @@
SmallVector<SDValue, 4> RetOps(1, Chain);
RetOps.append(OutVals.begin(), OutVals.end());
- const SDValue Ops[] = {Chain, OutVals.front()};
- Chain = DAG.getNode(WebAssemblyISD::RETURN, DL, MVT::Other, Ops);
+ Chain = DAG.getNode(WebAssemblyISD::RETURN, DL, MVT::Other, RetOps);
return Chain;
}
Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
===================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
@@ -26,7 +26,7 @@
//===----------------------------------------------------------------------===//
def SDT_WebAssemblyArgument : SDTypeProfile<1, 1, [SDTCisVT<1, i32>]>;
-def SDT_WebAssemblyReturn : SDTypeProfile<0, 1, []>;
+def SDT_WebAssemblyReturn : SDTypeProfile<0, -1, []>;
//===----------------------------------------------------------------------===//
// WebAssembly-specific DAG Nodes.
Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td
===================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td
@@ -29,5 +29,6 @@
isBarrier = 1 in {
//FIXME return more than just int32.
def RETURN : I<(outs), (ins Int32:$val), [(WebAssemblyreturn Int32:$val)]>;
+def RETURN_VOID : I<(outs), (ins), [(WebAssemblyreturn)]>;
} // hasSideEffects = 1, isReturn = 1, isTerminator = 1, hasCtrlDep = 1,
// isBarrier = 1
Index: llvm/trunk/test/CodeGen/WebAssembly/return-void.ll
===================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/return-void.ll
+++ llvm/trunk/test/CodeGen/WebAssembly/return-void.ll
@@ -0,0 +1,10 @@
+; RUN: llc < %s -asm-verbose=false | FileCheck %s
+
+target datalayout = "e-p:32:32-i64:64-v128:8:128-n32:64-S128"
+target triple = "wasm32-unknown-unknown"
+
+; CHECK-LABEL: return_void:
+; CHECK-NEXT: (RETURN_VOID)
+define void @return_void() {
+ ret void
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11692.31163.patch
Type: text/x-patch
Size: 2357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150731/d42424ce/attachment.bin>
More information about the llvm-commits
mailing list