diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2015-04-13 17:16:45 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2015-04-13 17:16:45 +0000 |
commit | a46c36b8f460923bf3fc351bd0e2abe30c8b8777 (patch) | |
tree | fb2b29f666151adbe14431ae0b83939c7d8f438c /llvm/test/CodeGen/X86/tailcall-mem-intrinsics.ll | |
parent | a283cb3265c21fe2ad00a562275327eb5f9baa30 (diff) | |
download | bcm5719-llvm-a46c36b8f460923bf3fc351bd0e2abe30c8b8777.tar.gz bcm5719-llvm-a46c36b8f460923bf3fc351bd0e2abe30c8b8777.zip |
Allow memory intrinsics to be tail calls
llvm-svn: 234764
Diffstat (limited to 'llvm/test/CodeGen/X86/tailcall-mem-intrinsics.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/tailcall-mem-intrinsics.ll | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/tailcall-mem-intrinsics.ll b/llvm/test/CodeGen/X86/tailcall-mem-intrinsics.ll new file mode 100644 index 00000000000..78c84c47d49 --- /dev/null +++ b/llvm/test/CodeGen/X86/tailcall-mem-intrinsics.ll @@ -0,0 +1,31 @@ +; RUN: llc -march=x86 < %s | FileCheck %s + +; CHECK-LABEL: tail_memcpy +; CHECK: jmp memcpy +define void @tail_memcpy(i8* nocapture %p, i8* nocapture readonly %q, i32 %n) #0 { +entry: + tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i32 1, i1 false) + ret void +} + +; CHECK-LABEL: tail_memset +; CHECK; jmp memmove +define void @tail_memmove(i8* nocapture %p, i8* nocapture readonly %q, i32 %n) #0 { +entry: + tail call void @llvm.memmove.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i32 1, i1 false) + ret void +} + +; CHECK-LABEL: tail_memset +; CHECK: jmp memset +define void @tail_memset(i8* nocapture %p, i8 %c, i32 %n) #0 { +entry: + tail call void @llvm.memset.p0i8.i32(i8* %p, i8 %c, i32 %n, i32 1, i1 false) + ret void +} + +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #0 +declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #0 +declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #0 + +attributes #0 = { nounwind } |