[llvm] r258895 - [WebAssembly] Add a test for the mem-intrinsic code in WebAssemblyPeephole.cpp
Dan Gohman via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 26 17:37:52 PST 2016
Author: djg
Date: Tue Jan 26 19:37:52 2016
New Revision: 258895
URL: http://llvm.org/viewvc/llvm-project?rev=258895&view=rev
Log:
[WebAssembly] Add a test for the mem-intrinsic code in WebAssemblyPeephole.cpp
Modified:
llvm/trunk/test/CodeGen/WebAssembly/mem-intrinsics.ll
Modified: llvm/trunk/test/CodeGen/WebAssembly/mem-intrinsics.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/mem-intrinsics.ll?rev=258895&r1=258894&r2=258895&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/mem-intrinsics.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/mem-intrinsics.ll Tue Jan 26 19:37:52 2016
@@ -74,3 +74,34 @@ entry:
call void @llvm.memset.p0i8.i32(i8* %1, i8 256, i32 1024, i32 16, i1 false)
ret void
}
+
+; If the result value of memset doesn't get stackified, it should be marked
+; $discard.
+
+; CHECK-LABEL: discard_result:
+; CHECK: i32.call $discard=, memset at FUNCTION, $0, $1, $2
+declare i8* @def()
+define i8* @discard_result(i8* %arg, i8 %arg1, i32 %arg2, i32 %arg3, i32 %arg4) {
+bb:
+ %tmp = icmp eq i32 %arg3, 0
+ br i1 %tmp, label %bb5, label %bb9
+
+bb5:
+ %tmp6 = icmp eq i32 %arg4, 0
+ br i1 %tmp6, label %bb7, label %bb8
+
+bb7:
+ call void @llvm.memset.p0i8.i32(i8* %arg, i8 %arg1, i32 %arg2, i32 1, i1 false)
+ br label %bb11
+
+bb8:
+ br label %bb11
+
+bb9:
+ %tmp10 = call i8* @def()
+ br label %bb11
+
+bb11:
+ %tmp12 = phi i8* [ %arg, %bb7 ], [ %arg, %bb8 ], [ %tmp10, %bb9 ]
+ ret i8* %tmp12
+}
More information about the llvm-commits
mailing list