diff options
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/X86/memcmp.ll | 16 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/mempcpy-32.ll | 20 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/mempcpy.ll | 10 |
3 files changed, 12 insertions, 34 deletions
diff --git a/llvm/test/CodeGen/X86/memcmp.ll b/llvm/test/CodeGen/X86/memcmp.ll index 02e2e1be547..6a51d60f636 100644 --- a/llvm/test/CodeGen/X86/memcmp.ll +++ b/llvm/test/CodeGen/X86/memcmp.ll @@ -7,11 +7,11 @@ @.str = private constant [23 x i8] c"fooooooooooooooooooooo\00", align 1 ; <[23 x i8]*> [#uses=1] -declare i32 @memcmp(i8*, i8*, i64) +declare i32 @memcmp(...) define void @memcmp2(i8* %X, i8* %Y, i32* nocapture %P) nounwind { entry: - %0 = tail call i32 @memcmp(i8* %X, i8* %Y, i64 2) nounwind ; <i32> [#uses=1] + %0 = tail call i32 (...) @memcmp(i8* %X, i8* %Y, i32 2) nounwind ; <i32> [#uses=1] %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1] br i1 %1, label %return, label %bb @@ -30,7 +30,7 @@ return: ; preds = %entry define void @memcmp2a(i8* %X, i32* nocapture %P) nounwind { entry: - %0 = tail call i32 @memcmp(i8* %X, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 1), i64 2) nounwind ; <i32> [#uses=1] + %0 = tail call i32 (...) @memcmp(i8* %X, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 1), i32 2) nounwind ; <i32> [#uses=1] %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1] br i1 %1, label %return, label %bb @@ -47,7 +47,7 @@ return: ; preds = %entry define void @memcmp2nb(i8* %X, i8* %Y, i32* nocapture %P) nounwind { entry: - %0 = tail call i32 @memcmp(i8* %X, i8* %Y, i64 2) nounwind nobuiltin ; <i32> [#uses=1] + %0 = tail call i32 (...) @memcmp(i8* %X, i8* %Y, i32 2) nounwind nobuiltin ; <i32> [#uses=1] %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1] br i1 %1, label %return, label %bb @@ -63,7 +63,7 @@ return: ; preds = %entry define void @memcmp4(i8* %X, i8* %Y, i32* nocapture %P) nounwind { entry: - %0 = tail call i32 @memcmp(i8* %X, i8* %Y, i64 4) nounwind ; <i32> [#uses=1] + %0 = tail call i32 (...) @memcmp(i8* %X, i8* %Y, i32 4) nounwind ; <i32> [#uses=1] %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1] br i1 %1, label %return, label %bb @@ -80,7 +80,7 @@ return: ; preds = %entry define void @memcmp4a(i8* %X, i32* nocapture %P) nounwind { entry: - %0 = tail call i32 @memcmp(i8* %X, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 1), i64 4) nounwind ; <i32> [#uses=1] + %0 = tail call i32 (...) @memcmp(i8* %X, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 1), i32 4) nounwind ; <i32> [#uses=1] %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1] br i1 %1, label %return, label %bb @@ -96,7 +96,7 @@ return: ; preds = %entry define void @memcmp8(i8* %X, i8* %Y, i32* nocapture %P) nounwind { entry: - %0 = tail call i32 @memcmp(i8* %X, i8* %Y, i64 8) nounwind ; <i32> [#uses=1] + %0 = tail call i32 (...) @memcmp(i8* %X, i8* %Y, i32 8) nounwind ; <i32> [#uses=1] %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1] br i1 %1, label %return, label %bb @@ -113,7 +113,7 @@ return: ; preds = %entry define void @memcmp8a(i8* %X, i32* nocapture %P) nounwind { entry: - %0 = tail call i32 @memcmp(i8* %X, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0), i64 8) nounwind ; <i32> [#uses=1] + %0 = tail call i32 (...) @memcmp(i8* %X, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0), i32 8) nounwind ; <i32> [#uses=1] %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1] br i1 %1, label %return, label %bb diff --git a/llvm/test/CodeGen/X86/mempcpy-32.ll b/llvm/test/CodeGen/X86/mempcpy-32.ll deleted file mode 100644 index 108442f6b64..00000000000 --- a/llvm/test/CodeGen/X86/mempcpy-32.ll +++ /dev/null @@ -1,20 +0,0 @@ -; RUN: llc < %s -mtriple=i686-unknown-linux -O2 | FileCheck %s - -; This tests the i686 lowering of mempcpy. -; Also see mempcpy.ll - -@G = common global i8* null, align 8 - -; CHECK-LABEL: RET_MEMPCPY: -; CHECK: movl [[REG:%e[a-z0-9]+]], {{.*}}G -; CHECK: calll {{.*}}memcpy -; CHECK: movl [[REG]], %eax -; -define i8* @RET_MEMPCPY(i8* %DST, i8* %SRC, i32 %N) { - %add.ptr = getelementptr inbounds i8, i8* %DST, i32 %N - store i8* %add.ptr, i8** @G, align 8 - %call = tail call i8* @mempcpy(i8* %DST, i8* %SRC, i32 %N) - ret i8* %call -} - -declare i8* @mempcpy(i8*, i8*, i32) diff --git a/llvm/test/CodeGen/X86/mempcpy.ll b/llvm/test/CodeGen/X86/mempcpy.ll index f8db255c1a4..1c737b64402 100644 --- a/llvm/test/CodeGen/X86/mempcpy.ll +++ b/llvm/test/CodeGen/X86/mempcpy.ll @@ -1,4 +1,5 @@ ; RUN: llc < %s -mtriple=x86_64-unknown-linux -O2 | FileCheck %s +; RUN: llc < %s -mtriple=i686-unknown-linux -O2 | FileCheck %s ; This test checks that: ; (1) mempcpy is lowered as memcpy, and @@ -10,15 +11,12 @@ ; the first instance to be reused as the return value. This allows the check for ; (2) to be expressed as verifying that the MOV to store DST+N to G and ; the MOV to copy DST+N to %rax use the same source register. - -; Also see mempcpy-32.ll - @G = common global i8* null, align 8 ; CHECK-LABEL: RET_MEMPCPY: -; CHECK: movq [[REG:%r[a-z0-9]+]], {{.*}}G -; CHECK: callq {{.*}}memcpy -; CHECK: movq [[REG]], %rax +; CHECK: mov{{.*}} [[REG:%[er][a-z0-9]+]], {{.*}}G +; CHECK: call{{.*}} {{.*}}memcpy +; CHECK: mov{{.*}} [[REG]], %{{[er]}}ax ; define i8* @RET_MEMPCPY(i8* %DST, i8* %SRC, i64 %N) { %add.ptr = getelementptr inbounds i8, i8* %DST, i64 %N |