[llvm] r182211 - Move the remaining simplify-libcalls tests to instcombine, merging most of them into a single file.

Benjamin Kramer benny.kra at googlemail.com
Sun May 19 06:28:39 PDT 2013


Author: d0k
Date: Sun May 19 08:28:39 2013
New Revision: 182211

URL: http://llvm.org/viewvc/llvm-project?rev=182211&view=rev
Log:
Move the remaining simplify-libcalls tests to instcombine, merging most of them into a single file.

Added:
    llvm/trunk/test/Transforms/InstCombine/PR7357.ll
      - copied, changed from r182209, llvm/trunk/test/Transforms/SimplifyLibCalls/PR7357.ll
    llvm/trunk/test/Transforms/InstCombine/float-shrink-compare.ll
      - copied, changed from r182209, llvm/trunk/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll
    llvm/trunk/test/Transforms/InstCombine/simplify-libcalls.ll
    llvm/trunk/test/Transforms/InstCombine/win-math.ll
      - copied, changed from r182209, llvm/trunk/test/Transforms/SimplifyLibCalls/win-math.ll
Removed:
    llvm/trunk/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll
    llvm/trunk/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll
    llvm/trunk/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll
    llvm/trunk/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll
    llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-28-Exit.ll
    llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-29-Exit2.ll
    llvm/trunk/test/Transforms/SimplifyLibCalls/MemCpy.ll
    llvm/trunk/test/Transforms/SimplifyLibCalls/PR7357.ll
    llvm/trunk/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll
    llvm/trunk/test/Transforms/SimplifyLibCalls/lit.local.cfg
    llvm/trunk/test/Transforms/SimplifyLibCalls/win-math.ll

Copied: llvm/trunk/test/Transforms/InstCombine/PR7357.ll (from r182209, llvm/trunk/test/Transforms/SimplifyLibCalls/PR7357.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/PR7357.ll?p2=llvm/trunk/test/Transforms/InstCombine/PR7357.ll&p1=llvm/trunk/test/Transforms/SimplifyLibCalls/PR7357.ll&r1=182209&r2=182211&rev=182211&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/PR7357.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/PR7357.ll Sun May 19 08:28:39 2013
@@ -1,4 +1,4 @@
-; RUN: opt < %s "-default-data-layout=e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32" -simplify-libcalls -S | FileCheck %s
+; RUN: opt < %s "-default-data-layout=e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32" -instcombine -S | FileCheck %s
 @.str1 = private constant [11 x i8] c"(){};[]&|:\00", align 4
 
 ; check that simplify libcalls will not replace a call with one calling
@@ -8,9 +8,10 @@
 ; CHECK: call arm_aapcscc  i8* @strchr
 define arm_aapcscc i32 @foo(i32 %argc) nounwind {
 bb.nph:
-  call arm_aapcscc  i8* @strchr(i8* getelementptr ([11 x i8]* @.str1, i32 0,
+  %c = call arm_aapcscc  i8* @strchr(i8* getelementptr ([11 x i8]* @.str1, i32 0,
 i32 0), i32 %argc) nounwind readonly
-  ret i32 0
+  %p = ptrtoint i8* %c to i32
+  ret i32 %p
 }
 
 declare arm_aapcscc i8* @strchr(i8*, i32) nounwind readonly

Copied: llvm/trunk/test/Transforms/InstCombine/float-shrink-compare.ll (from r182209, llvm/trunk/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/float-shrink-compare.ll?p2=llvm/trunk/test/Transforms/InstCombine/float-shrink-compare.ll&p1=llvm/trunk/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll&r1=182209&r2=182211&rev=182211&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/float-shrink-compare.ll Sun May 19 08:28:39 2013
@@ -1,4 +1,4 @@
-; RUN: opt -S -simplify-libcalls -instcombine < %s | FileCheck %s
+; RUN: opt -S -instcombine < %s | FileCheck %s
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.8.0"
 

Added: llvm/trunk/test/Transforms/InstCombine/simplify-libcalls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/simplify-libcalls.ll?rev=182211&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/simplify-libcalls.ll (added)
+++ llvm/trunk/test/Transforms/InstCombine/simplify-libcalls.ll Sun May 19 08:28:39 2013
@@ -0,0 +1,132 @@
+; RUN: opt -S < %s -instcombine | FileCheck %s
+
+ at G = constant [3 x i8] c"%s\00"		; <[3 x i8]*> [#uses=1]
+
+declare i32 @sprintf(i8*, i8*, ...)
+
+define void @foo(i8* %P, i32* %X) {
+	call i32 (i8*, i8*, ...)* @sprintf( i8* %P, i8* getelementptr ([3 x i8]* @G, i32 0, i32 0), i32* %X )		; <i32>:1 [#uses=0]
+	ret void
+}
+
+; PR1307
+ at str = internal constant [5 x i8] c"foog\00"
+ at str1 = internal constant [8 x i8] c"blahhh!\00"
+ at str2 = internal constant [5 x i8] c"Ponk\00"
+
+define i8* @test1() {
+        %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8]* @str, i32 0, i32 2), i32 103 )              ; <i8*> [#uses=1]
+        ret i8* %tmp3
+
+; CHECK: @test1
+; CHECK: ret i8* getelementptr inbounds ([5 x i8]* @str, i32 0, i64 3)
+}
+
+declare i8* @strchr(i8*, i32)
+
+define i8* @test2() {
+        %tmp3 = tail call i8* @strchr( i8* getelementptr ([8 x i8]* @str1, i32 0, i32 2), i32 0 )               ; <i8*> [#uses=1]
+        ret i8* %tmp3
+
+; CHECK: @test2
+; CHECK: ret i8* getelementptr inbounds ([8 x i8]* @str1, i32 0, i64 7)
+}
+
+define i8* @test3() {
+entry:
+        %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8]* @str2, i32 0, i32 1), i32 80 )              ; <i8*> [#uses=1]
+        ret i8* %tmp3
+
+; CHECK: @test3
+; CHECK: ret i8* null
+}
+
+ at _2E_str = external constant [5 x i8]		; <[5 x i8]*> [#uses=1]
+
+declare i32 @memcmp(i8*, i8*, i32) nounwind readonly
+
+define i1 @PR2341(i8** %start_addr) {
+entry:
+	%tmp4 = load i8** %start_addr, align 4		; <i8*> [#uses=1]
+	%tmp5 = call i32 @memcmp( i8* %tmp4, i8* getelementptr ([5 x i8]* @_2E_str, i32 0, i32 0), i32 4 ) nounwind readonly 		; <i32> [#uses=1]
+	%tmp6 = icmp eq i32 %tmp5, 0		; <i1> [#uses=1]
+	ret i1 %tmp6
+
+; CHECK: @PR2341
+; CHECK: i32
+}
+
+define i32 @PR4284() nounwind {
+entry:
+	%c0 = alloca i8, align 1		; <i8*> [#uses=2]
+	%c2 = alloca i8, align 1		; <i8*> [#uses=2]
+	store i8 64, i8* %c0
+	store i8 -127, i8* %c2
+	%call = call i32 @memcmp(i8* %c0, i8* %c2, i32 1)		; <i32> [#uses=1]
+	ret i32 %call
+
+; CHECK: @PR4284
+; CHECK: ret i32 -65
+}
+
+%struct.__sFILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, i8*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64, %struct.pthread_mutex*, %struct.pthread*, i32, i32, %union.anon }
+%struct.__sbuf = type { i8*, i32, [4 x i8] }
+%struct.pthread = type opaque
+%struct.pthread_mutex = type opaque
+%union.anon = type { i64, [120 x i8] }
+ at .str13 = external constant [2 x i8]		; <[2 x i8]*> [#uses=1]
+ at .str14 = external constant [2 x i8]		; <[2 x i8]*> [#uses=1]
+
+define i32 @PR4641(i32 %argc, i8** %argv) nounwind {
+entry:
+	call void @exit(i32 0) nounwind
+	%cond392 = select i1 undef, i8* getelementptr ([2 x i8]* @.str13, i32 0, i32 0), i8* getelementptr ([2 x i8]* @.str14, i32 0, i32 0)		; <i8*> [#uses=1]
+	%call393 = call %struct.__sFILE* @fopen(i8* undef, i8* %cond392) nounwind		; <%struct.__sFILE*> [#uses=0]
+	unreachable
+}
+
+declare %struct.__sFILE* @fopen(i8*, i8*)
+
+declare void @exit(i32)
+
+define i32 @PR4645() {
+entry:
+	br label %if.then
+
+lor.lhs.false:		; preds = %while.body
+	br i1 undef, label %if.then, label %for.cond
+
+if.then:		; preds = %lor.lhs.false, %while.body
+	call void @exit(i32 1)
+	br label %for.cond
+
+for.cond:		; preds = %for.end, %if.then, %lor.lhs.false
+	%j.0 = phi i32 [ %inc47, %for.end ], [ 0, %if.then ], [ 0, %lor.lhs.false ]		; <i32> [#uses=1]
+	unreachable
+
+for.end:		; preds = %for.cond20
+	%inc47 = add i32 %j.0, 1		; <i32> [#uses=1]
+	br label %for.cond
+}
+
+ at h = constant [2 x i8] c"h\00"		; <[2 x i8]*> [#uses=1]
+ at hel = constant [4 x i8] c"hel\00"		; <[4 x i8]*> [#uses=1]
+ at hello_u = constant [8 x i8] c"hello_u\00"		; <[8 x i8]*> [#uses=1]
+
+define i32 @MemCpy() {
+  %h_p = getelementptr [2 x i8]* @h, i32 0, i32 0
+  %hel_p = getelementptr [4 x i8]* @hel, i32 0, i32 0
+  %hello_u_p = getelementptr [8 x i8]* @hello_u, i32 0, i32 0
+  %target = alloca [1024 x i8]
+  %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0
+  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %target_p, i8* %h_p, i32 2, i32 2, i1 false)
+  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %target_p, i8* %hel_p, i32 4, i32 4, i1 false)
+  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %target_p, i8* %hello_u_p, i32 8, i32 8, i1 false)
+  ret i32 0
+
+; CHECK: @MemCpy
+; CHECK-NOT: llvm.memcpy
+; CHECK: ret i32 0
+}
+
+declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind

Copied: llvm/trunk/test/Transforms/InstCombine/win-math.ll (from r182209, llvm/trunk/test/Transforms/SimplifyLibCalls/win-math.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/win-math.ll?p2=llvm/trunk/test/Transforms/InstCombine/win-math.ll&p1=llvm/trunk/test/Transforms/SimplifyLibCalls/win-math.ll&r1=182209&r2=182211&rev=182211&view=diff
==============================================================================
    (empty)

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/2005-05-20-sprintf-crash.ll (removed)
@@ -1,11 +0,0 @@
-; RUN: opt < %s -simplify-libcalls -disable-output
-
- at G = constant [3 x i8] c"%s\00"		; <[3 x i8]*> [#uses=1]
-
-declare i32 @sprintf(i8*, i8*, ...)
-
-define void @foo(i8* %P, i32* %X) {
-	call i32 (i8*, i8*, ...)* @sprintf( i8* %P, i8* getelementptr ([3 x i8]* @G, i32 0, i32 0), i32* %X )		; <i32>:1 [#uses=0]
-	ret void
-}
-

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/2007-04-06-strchr-miscompile.ll (removed)
@@ -1,29 +0,0 @@
-; PR1307
-; RUN: opt < %s -simplify-libcalls -instcombine -S > %t
-; RUN: grep "@str,.*i64 3" %t
-; RUN: grep "@str1,.*i64 7" %t
-; RUN: grep "ret i8.*null" %t
-; END.
-
- at str = internal constant [5 x i8] c"foog\00"
- at str1 = internal constant [8 x i8] c"blahhh!\00"
- at str2 = internal constant [5 x i8] c"Ponk\00"
-
-define i8* @test1() {
-        %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8]* @str, i32 0, i32 2), i32 103 )              ; <i8*> [#uses=1]
-        ret i8* %tmp3
-}
-
-declare i8* @strchr(i8*, i32)
-
-define i8* @test2() {
-        %tmp3 = tail call i8* @strchr( i8* getelementptr ([8 x i8]* @str1, i32 0, i32 2), i32 0 )               ; <i8*> [#uses=1]
-        ret i8* %tmp3
-}
-
-define i8* @test3() {
-entry:
-        %tmp3 = tail call i8* @strchr( i8* getelementptr ([5 x i8]* @str2, i32 0, i32 1), i32 80 )              ; <i8*> [#uses=1]
-        ret i8* %tmp3
-}
-

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll (removed)
@@ -1,14 +0,0 @@
-; RUN: opt < %s -simplify-libcalls -S | grep i32
-; PR2341
-
- at _2E_str = external constant [5 x i8]		; <[5 x i8]*> [#uses=1]
-
-declare i32 @memcmp(i8*, i8*, i32) nounwind readonly 
-
-define i1 @f(i8** %start_addr) {
-entry:
-	%tmp4 = load i8** %start_addr, align 4		; <i8*> [#uses=1]
-	%tmp5 = call i32 @memcmp( i8* %tmp4, i8* getelementptr ([5 x i8]* @_2E_str, i32 0, i32 0), i32 4 ) nounwind readonly 		; <i32> [#uses=1]
-	%tmp6 = icmp eq i32 %tmp5, 0		; <i1> [#uses=1]
-	ret i1 %tmp6
-}

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/2009-05-30-memcmp-byte.ll (removed)
@@ -1,14 +0,0 @@
-; RUN: opt < %s -simplify-libcalls -instcombine -S | grep "ret i32 -65"
-; PR4284
-
-define i32 @test() nounwind {
-entry:
-	%c0 = alloca i8, align 1		; <i8*> [#uses=2]
-	%c2 = alloca i8, align 1		; <i8*> [#uses=2]
-	store i8 64, i8* %c0
-	store i8 -127, i8* %c2
-	%call = call i32 @memcmp(i8* %c0, i8* %c2, i32 1)		; <i32> [#uses=1]
-	ret i32 %call
-}
-
-declare i32 @memcmp(i8*, i8*, i32)

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-28-Exit.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-28-Exit.ll?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-28-Exit.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-28-Exit.ll (removed)
@@ -1,22 +0,0 @@
-; RUN: opt < %s -simplify-libcalls -disable-output
-; PR4641
-
-	%struct.__sFILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, i8*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64, %struct.pthread_mutex*, %struct.pthread*, i32, i32, %union.anon }
-	%struct.__sbuf = type { i8*, i32, [4 x i8] }
-	%struct.pthread = type opaque
-	%struct.pthread_mutex = type opaque
-	%union.anon = type { i64, [120 x i8] }
- at .str13 = external constant [2 x i8]		; <[2 x i8]*> [#uses=1]
- at .str14 = external constant [2 x i8]		; <[2 x i8]*> [#uses=1]
-
-define i32 @main(i32 %argc, i8** %argv) nounwind {
-entry:
-	call void @exit(i32 0) nounwind
-	%cond392 = select i1 undef, i8* getelementptr ([2 x i8]* @.str13, i32 0, i32 0), i8* getelementptr ([2 x i8]* @.str14, i32 0, i32 0)		; <i8*> [#uses=1]
-	%call393 = call %struct.__sFILE* @fopen(i8* undef, i8* %cond392) nounwind		; <%struct.__sFILE*> [#uses=0]
-	unreachable
-}
-
-declare %struct.__sFILE* @fopen(i8*, i8*)
-
-declare void @exit(i32)

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-29-Exit2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-29-Exit2.ll?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-29-Exit2.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/2009-07-29-Exit2.ll (removed)
@@ -1,24 +0,0 @@
-; RUN: opt < %s -simplify-libcalls -disable-output
-; PR4645
-
-define i32 @main() {
-entry:
-	br label %if.then
-
-lor.lhs.false:		; preds = %while.body
-	br i1 undef, label %if.then, label %for.cond
-
-if.then:		; preds = %lor.lhs.false, %while.body
-	call void @exit(i32 1)
-	br label %for.cond
-
-for.cond:		; preds = %for.end, %if.then, %lor.lhs.false
-	%j.0 = phi i32 [ %inc47, %for.end ], [ 0, %if.then ], [ 0, %lor.lhs.false ]		; <i32> [#uses=1]
-	unreachable
-
-for.end:		; preds = %for.cond20
-	%inc47 = add i32 %j.0, 1		; <i32> [#uses=1]
-	br label %for.cond
-}
-
-declare void @exit(i32)

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/MemCpy.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/MemCpy.ll?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/MemCpy.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/MemCpy.ll (removed)
@@ -1,19 +0,0 @@
-; RUN: opt < %s -constprop -instcombine -S | not grep "call.*llvm.memcpy.i32"
-
- at h = constant [2 x i8] c"h\00"		; <[2 x i8]*> [#uses=1]
- at hel = constant [4 x i8] c"hel\00"		; <[4 x i8]*> [#uses=1]
- at hello_u = constant [8 x i8] c"hello_u\00"		; <[8 x i8]*> [#uses=1]
-
-define i32 @main() {
-  %h_p = getelementptr [2 x i8]* @h, i32 0, i32 0
-  %hel_p = getelementptr [4 x i8]* @hel, i32 0, i32 0
-  %hello_u_p = getelementptr [8 x i8]* @hello_u, i32 0, i32 0
-  %target = alloca [1024 x i8]
-  %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0
-  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %target_p, i8* %h_p, i32 2, i32 2, i1 false)
-  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %target_p, i8* %hel_p, i32 4, i32 4, i1 false)
-  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %target_p, i8* %hello_u_p, i32 8, i32 8, i1 false)
-  ret i32 0
-}
-
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/PR7357.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/PR7357.ll?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/PR7357.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/PR7357.ll (removed)
@@ -1,16 +0,0 @@
-; RUN: opt < %s "-default-data-layout=e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32" -simplify-libcalls -S | FileCheck %s
- at .str1 = private constant [11 x i8] c"(){};[]&|:\00", align 4
-
-; check that simplify libcalls will not replace a call with one calling
-; convention with a new call with a different calling convention.
-
-; CHECK: define arm_aapcscc i32 @foo(i32 %argc)
-; CHECK: call arm_aapcscc  i8* @strchr
-define arm_aapcscc i32 @foo(i32 %argc) nounwind {
-bb.nph:
-  call arm_aapcscc  i8* @strchr(i8* getelementptr ([11 x i8]* @.str1, i32 0,
-i32 0), i32 %argc) nounwind readonly
-  ret i32 0
-}
-
-declare arm_aapcscc i8* @strchr(i8*, i32) nounwind readonly

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll (removed)
@@ -1,179 +0,0 @@
-; RUN: opt -S -simplify-libcalls -instcombine < %s | FileCheck %s
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
-target triple = "x86_64-apple-macosx10.8.0"
-
-define i32 @test1(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %x to double
-  %2 = call double @ceil(double %1) nounwind readnone
-  %3 = fpext float %y to double
-  %4 = fcmp oeq double %2, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test1
-; CHECK-NEXT: %ceilf = call float @ceilf(float %x)
-; CHECK-NEXT: fcmp oeq float %ceilf, %y
-}
-
-define i32 @test2(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %x to double
-  %2 = call double @fabs(double %1) nounwind readnone
-  %3 = fpext float %y to double
-  %4 = fcmp oeq double %2, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test2
-; CHECK-NEXT: %fabsf = call float @fabsf(float %x)
-; CHECK-NEXT: fcmp oeq float %fabsf, %y
-}
-
-define i32 @test3(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %x to double
-  %2 = call double @floor(double %1) nounwind readnone
-  %3 = fpext float %y to double
-  %4 = fcmp oeq double %2, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test3
-; CHECK-NEXT: %floorf = call float @floorf(float %x)
-; CHECK-NEXT: fcmp oeq float %floorf, %y
-}
-
-define i32 @test4(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %x to double
-  %2 = call double @nearbyint(double %1) nounwind
-  %3 = fpext float %y to double
-  %4 = fcmp oeq double %2, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test4
-; CHECK-NEXT: %nearbyintf = call float @nearbyintf(float %x)
-; CHECK-NEXT: fcmp oeq float %nearbyintf, %y
-}
-
-define i32 @test5(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %x to double
-  %2 = call double @rint(double %1) nounwind
-  %3 = fpext float %y to double
-  %4 = fcmp oeq double %2, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test5
-; CHECK-NEXT: %rintf = call float @rintf(float %x)
-; CHECK-NEXT: fcmp oeq float %rintf, %y
-}
-
-define i32 @test6(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %x to double
-  %2 = call double @round(double %1) nounwind readnone
-  %3 = fpext float %y to double
-  %4 = fcmp oeq double %2, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test6
-; CHECK-NEXT: %roundf = call float @roundf(float %x)
-; CHECK-NEXT: fcmp oeq float %roundf, %y
-}
-
-define i32 @test7(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %x to double
-  %2 = call double @trunc(double %1) nounwind
-  %3 = fpext float %y to double
-  %4 = fcmp oeq double %2, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test7
-; CHECK-NEXT: %truncf = call float @truncf(float %x)
-; CHECK-NEXT: fcmp oeq float %truncf, %y
-}
-
-define i32 @test8(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %y to double
-  %2 = fpext float %x to double
-  %3 = call double @ceil(double %2) nounwind readnone
-  %4 = fcmp oeq double %1, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test8
-; CHECK-NEXT: %ceilf = call float @ceilf(float %x)
-; CHECK-NEXT: fcmp oeq float %ceilf, %y
-}
-
-define i32 @test9(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %y to double
-  %2 = fpext float %x to double
-  %3 = call double @fabs(double %2) nounwind readnone
-  %4 = fcmp oeq double %1, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test9
-; CHECK-NEXT: %fabsf = call float @fabsf(float %x)
-; CHECK-NEXT: fcmp oeq float %fabsf, %y
-}
-
-define i32 @test10(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %y to double
-  %2 = fpext float %x to double
-  %3 = call double @floor(double %2) nounwind readnone
-  %4 = fcmp oeq double %1, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test10
-; CHECK-NEXT: %floorf = call float @floorf(float %x)
-; CHECK-NEXT: fcmp oeq float %floorf, %y
-}
-
-define i32 @test11(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %y to double
-  %2 = fpext float %x to double
-  %3 = call double @nearbyint(double %2) nounwind
-  %4 = fcmp oeq double %1, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test11
-; CHECK-NEXT: %nearbyintf = call float @nearbyintf(float %x)
-; CHECK-NEXT: fcmp oeq float %nearbyintf, %y
-}
-
-define i32 @test12(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %y to double
-  %2 = fpext float %x to double
-  %3 = call double @rint(double %2) nounwind
-  %4 = fcmp oeq double %1, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test12
-; CHECK-NEXT: %rintf = call float @rintf(float %x)
-; CHECK-NEXT: fcmp oeq float %rintf, %y
-}
-
-define i32 @test13(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %y to double
-  %2 = fpext float %x to double
-  %3 = call double @round(double %2) nounwind readnone
-  %4 = fcmp oeq double %1, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test13
-; CHECK-NEXT: %roundf = call float @roundf(float %x)
-; CHECK-NEXT: fcmp oeq float %roundf, %y
-}
-
-define i32 @test14(float %x, float %y) nounwind uwtable {
-  %1 = fpext float %y to double
-  %2 = fpext float %x to double
-  %3 = call double @trunc(double %2) nounwind
-  %4 = fcmp oeq double %1, %3
-  %5 = zext i1 %4 to i32
-  ret i32 %5
-; CHECK: @test14
-; CHECK-NEXT: %truncf = call float @truncf(float %x)
-; CHECK-NEXT: fcmp oeq float %truncf, %y
-}
-
-declare double @fabs(double) nounwind readnone
-declare double @ceil(double) nounwind readnone
-declare double @floor(double) nounwind readnone
-declare double @nearbyint(double) nounwind readnone
-declare double @rint(double) nounwind readnone
-declare double @round(double) nounwind readnone
-declare double @trunc(double) nounwind readnone

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/lit.local.cfg?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/lit.local.cfg (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/lit.local.cfg (removed)
@@ -1 +0,0 @@
-config.suffixes = ['.ll', '.c', '.cpp']

Removed: llvm/trunk/test/Transforms/SimplifyLibCalls/win-math.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/win-math.ll?rev=182210&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/win-math.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/win-math.ll (removed)
@@ -1,275 +0,0 @@
-; RUN: opt -O2 -S -mtriple=i386-pc-win32 < %s | FileCheck %s -check-prefix=WIN32
-; RUN: opt -O2 -S -mtriple=x86_64-pc-win32 < %s | FileCheck %s -check-prefix=WIN64
-; RUN: opt -O2 -S -mtriple=i386-pc-mingw32 < %s | FileCheck %s -check-prefix=MINGW32
-; RUN: opt -O2 -S -mtriple=x86_64-pc-mingw32 < %s | FileCheck %s -check-prefix=MINGW64
-
-; x86 win32 msvcrt does not provide entry points for single-precision libm.
-; x86-64 win32 msvcrt does (except for fabsf)
-; msvcrt does not provide C99 math, but mingw32 does.
-
-declare double @acos(double %x)
-define float @float_acos(float %x) nounwind readnone {
-; WIN32: @float_acos
-; WIN32-NOT: float @acosf
-; WIN32: double @acos
-    %1 = fpext float %x to double
-    %2 = call double @acos(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @asin(double %x)
-define float @float_asin(float %x) nounwind readnone {
-; WIN32: @float_asin
-; WIN32-NOT: float @asinf
-; WIN32: double @asin
-    %1 = fpext float %x to double
-    %2 = call double @asin(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @atan(double %x)
-define float @float_atan(float %x) nounwind readnone {
-; WIN32: @float_atan
-; WIN32-NOT: float @atanf
-; WIN32: double @atan
-    %1 = fpext float %x to double
-    %2 = call double @atan(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @atan2(double %x, double %y)
-define float @float_atan2(float %x, float %y) nounwind readnone {
-; WIN32: @float_atan2
-; WIN32-NOT: float @atan2f
-; WIN32: double @atan2
-    %1 = fpext float %x to double
-    %2 = fpext float %y to double
-    %3 = call double @atan2(double %1, double %2)
-    %4 = fptrunc double %3 to float
-    ret float %4
-}
-
-declare double @ceil(double %x)
-define float @float_ceil(float %x) nounwind readnone {
-; WIN32: @float_ceil
-; WIN32-NOT: float @ceilf
-; WIN32: double @ceil
-; WIN64: @float_ceil
-; WIN64: float @ceilf
-; WIN64-NOT: double @ceil
-; MINGW32: @float_ceil
-; MINGW32: float @ceilf
-; MINGW32-NOT: double @ceil
-; MINGW64: @float_ceil
-; MINGW64: float @ceilf
-; MINGW64-NOT: double @ceil
-    %1 = fpext float %x to double
-    %2 = call double @ceil(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @_copysign(double %x)
-define float @float_copysign(float %x) nounwind readnone {
-; WIN32: @float_copysign
-; WIN32-NOT: float @copysignf
-; WIN32-NOT: float @_copysignf
-; WIN32: double @_copysign
-    %1 = fpext float %x to double
-    %2 = call double @_copysign(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @cos(double %x)
-define float @float_cos(float %x) nounwind readnone {
-; WIN32: @float_cos
-; WIN32-NOT: float @cosf
-; WIN32: double @cos
-    %1 = fpext float %x to double
-    %2 = call double @cos(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @cosh(double %x)
-define float @float_cosh(float %x) nounwind readnone {
-; WIN32: @float_cosh
-; WIN32-NOT: float @coshf
-; WIN32: double @cosh
-    %1 = fpext float %x to double
-    %2 = call double @cosh(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @exp(double %x, double %y)
-define float @float_exp(float %x, float %y) nounwind readnone {
-; WIN32: @float_exp
-; WIN32-NOT: float @expf
-; WIN32: double @exp
-    %1 = fpext float %x to double
-    %2 = fpext float %y to double
-    %3 = call double @exp(double %1, double %2)
-    %4 = fptrunc double %3 to float
-    ret float %4
-}
-
-declare double @fabs(double %x, double %y)
-define float @float_fabs(float %x, float %y) nounwind readnone {
-; WIN32: @float_fabs
-; WIN32-NOT: float @fabsf
-; WIN32: double @fabs
-; WIN64: @float_fabs
-; WIN64-NOT: float @fabsf
-; WIN64: double @fabs
-    %1 = fpext float %x to double
-    %2 = fpext float %y to double
-    %3 = call double @fabs(double %1, double %2)
-    %4 = fptrunc double %3 to float
-    ret float %4
-}
-
-declare double @floor(double %x)
-define float @float_floor(float %x) nounwind readnone {
-; WIN32: @float_floor
-; WIN32-NOT: float @floorf
-; WIN32: double @floor
-; WIN64: @float_floor
-; WIN64: float @floorf
-; WIN64-NOT: double @floor
-; MINGW32: @float_floor
-; MINGW32: float @floorf
-; MINGW32-NOT: double @floor
-; MINGW64: @float_floor
-; MINGW64: float @floorf
-; MINGW64-NOT: double @floor
-    %1 = fpext float %x to double
-    %2 = call double @floor(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @fmod(double %x, double %y)
-define float @float_fmod(float %x, float %y) nounwind readnone {
-; WIN32: @float_fmod
-; WIN32-NOT: float @fmodf
-; WIN32: double @fmod
-    %1 = fpext float %x to double
-    %2 = fpext float %y to double
-    %3 = call double @fmod(double %1, double %2)
-    %4 = fptrunc double %3 to float
-    ret float %4
-}
-
-declare double @log(double %x)
-define float @float_log(float %x) nounwind readnone {
-; WIN32: @float_log
-; WIN32-NOT: float @logf
-; WIN32: double @log
-    %1 = fpext float %x to double
-    %2 = call double @log(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @pow(double %x, double %y)
-define float @float_pow(float %x, float %y) nounwind readnone {
-; WIN32: @float_pow
-; WIN32-NOT: float @powf
-; WIN32: double @pow
-    %1 = fpext float %x to double
-    %2 = fpext float %y to double
-    %3 = call double @pow(double %1, double %2)
-    %4 = fptrunc double %3 to float
-    ret float %4
-}
-
-declare double @sin(double %x)
-define float @float_sin(float %x) nounwind readnone {
-; WIN32: @float_sin
-; WIN32-NOT: float @sinf
-; WIN32: double @sin
-    %1 = fpext float %x to double
-    %2 = call double @sin(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @sinh(double %x)
-define float @float_sinh(float %x) nounwind readnone {
-; WIN32: @float_sinh
-; WIN32-NOT: float @sinhf
-; WIN32: double @sinh
-    %1 = fpext float %x to double
-    %2 = call double @sinh(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @sqrt(double %x)
-define float @float_sqrt(float %x) nounwind readnone {
-; WIN32: @float_sqrt
-; WIN32-NOT: float @sqrtf
-; WIN32: double @sqrt
-; WIN64: @float_sqrt
-; WIN64: float @sqrtf
-; WIN64-NOT: double @sqrt
-; MINGW32: @float_sqrt
-; MINGW32: float @sqrtf
-; MINGW32-NOT: double @sqrt
-; MINGW64: @float_sqrt
-; MINGW64: float @sqrtf
-; MINGW64-NOT: double @sqrt
-    %1 = fpext float %x to double
-    %2 = call double @sqrt(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @tan(double %x)
-define float @float_tan(float %x) nounwind readnone {
-; WIN32: @float_tan
-; WIN32-NOT: float @tanf
-; WIN32: double @tan
-    %1 = fpext float %x to double
-    %2 = call double @tan(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-declare double @tanh(double %x)
-define float @float_tanh(float %x) nounwind readnone {
-; WIN32: @float_tanh
-; WIN32-NOT: float @tanhf
-; WIN32: double @tanh
-    %1 = fpext float %x to double
-    %2 = call double @tanh(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-
-; win32 does not have round; mingw32 does
-declare double @round(double %x)
-define float @float_round(float %x) nounwind readnone {
-; WIN32: @float_round
-; WIN32-NOT: float @roundf
-; WIN32: double @round
-; WIN64: @float_round
-; WIN64-NOT: float @roundf
-; WIN64: double @round
-; MINGW32: @float_round
-; MINGW32: float @roundf
-; MINGW32-NOT: double @round
-; MINGW64: @float_round
-; MINGW64: float @roundf
-; MINGW64-NOT: double @round
-    %1 = fpext float %x to double
-    %2 = call double @round(double %1)
-    %3 = fptrunc double %2 to float
-    ret float %3
-}
-





More information about the llvm-commits mailing list