diff options
Diffstat (limited to 'test/Transforms/SimplifyLibCalls')
23 files changed, 1 insertions, 971 deletions
diff --git a/test/Transforms/SimplifyLibCalls/2009-01-04-Annotate.ll b/test/Transforms/SimplifyLibCalls/2009-01-04-Annotate.ll deleted file mode 100644 index 73eb05b05e34..000000000000 --- a/test/Transforms/SimplifyLibCalls/2009-01-04-Annotate.ll +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -S > %t -; RUN: grep noalias %t | count 2 -; RUN: grep nocapture %t | count 3 -; RUN: grep nounwind %t | count 3 -; RUN: grep readonly %t | count 1 - -declare i8* @fopen(i8*, i8*) -declare i8 @strlen(i8*) -declare i32* @realloc(i32*, i32) - -; Test deliberately wrong declaration -declare i32 @strcpy(...) diff --git a/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll b/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll deleted file mode 100644 index ac89199b0ec1..000000000000 --- a/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll +++ /dev/null @@ -1,13 +0,0 @@ -; RUN: opt < %s -inline -simplify-libcalls -functionattrs | \ -; RUN: llvm-dis | grep nocapture | count 2 -; Check that nocapture attributes are added when run after an SCC pass. -; PR3520 - -define i32 @use(i8* %x) nounwind readonly { -entry: - %0 = tail call i64 @strlen(i8* %x) nounwind readonly ; <i64> [#uses=1] - %1 = trunc i64 %0 to i32 ; <i32> [#uses=1] - ret i32 %1 -} - -declare i64 @strlen(i8*) nounwind readonly diff --git a/test/Transforms/SimplifyLibCalls/2010-05-30-memcpy-Struct.ll b/test/Transforms/SimplifyLibCalls/2010-05-30-memcpy-Struct.ll deleted file mode 100644 index f67bae74f503..000000000000 --- a/test/Transforms/SimplifyLibCalls/2010-05-30-memcpy-Struct.ll +++ /dev/null @@ -1,20 +0,0 @@ -; RUN: opt -simplify-libcalls %s -S -o - | FileCheck %s -; PR7265 - -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" -target triple = "x86_64-unknown-linux-gnu" - -%union.anon = type { i32, [4 x i8] } - -@.str = private constant [3 x i8] c"%s\00" ; <[3 x i8]*> [#uses=2] - -define void @CopyEventArg(%union.anon* %ev) nounwind { -entry: - %call = call i32 (i8*, i8*, ...)* @sprintf(i8* undef, i8* getelementptr inbounds ([3 x i8]* @.str, i64 0, i64 0), %union.anon* %ev) nounwind ; <i32> [#uses=0] -; CHECK: bitcast %union.anon* %ev to i8* -; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64 - ret void -} - -declare i32 @sprintf(i8*, i8*, ...) - diff --git a/test/Transforms/SimplifyLibCalls/FFS.ll b/test/Transforms/SimplifyLibCalls/FFS.ll deleted file mode 100644 index 6aecbeacd7e6..000000000000 --- a/test/Transforms/SimplifyLibCalls/FFS.ll +++ /dev/null @@ -1,45 +0,0 @@ -; Test that FFSOpt works correctly -; RUN: opt < %s -simplify-libcalls -S | FileCheck %s - -; CHECK-NOT: call{{.*}}@ffs - -@non_const = external global i32 ; <i32*> [#uses=1] - -declare i32 @ffs(i32) - -declare i32 @ffsl(i32) - -declare i32 @ffsll(i64) - -define i32 @main() { - %arg = load i32* @non_const ; <i32> [#uses=1] - %val0 = call i32 @ffs( i32 %arg ) ; <i32> [#uses=1] - %val1 = call i32 @ffs( i32 1 ) ; <i32> [#uses=1] - %val2 = call i32 @ffs( i32 2048 ) ; <i32> [#uses=1] - %val3 = call i32 @ffsl( i32 65536 ) ; <i32> [#uses=1] - %val4 = call i32 @ffsll( i64 1024 ) ; <i32> [#uses=1] - %val5 = call i32 @ffsll( i64 17179869184 ) ; <i32> [#uses=1] - %val6 = call i32 @ffsll( i64 1152921504606846976 ) ; <i32> [#uses=1] - %rslt1 = add i32 %val1, %val2 ; <i32> [#uses=1] - %rslt2 = add i32 %val3, %val4 ; <i32> [#uses=1] - %rslt3 = add i32 %val5, %val6 ; <i32> [#uses=1] - %rslt4 = add i32 %rslt1, %rslt2 ; <i32> [#uses=1] - %rslt5 = add i32 %rslt4, %rslt3 ; <i32> [#uses=2] - %rslt6 = add i32 %rslt5, %val0 ; <i32> [#uses=0] - ret i32 %rslt5 -} - - -; PR4206 -define i32 @a(i64) nounwind { - %2 = call i32 @ffsll(i64 %0) ; <i32> [#uses=1] - ret i32 %2 -} - -; PR13028 -define i32 @b() nounwind { - %ffs = call i32 @ffsll(i64 0) - ret i32 %ffs -; CHECK: @b -; CHECK-NEXT: ret i32 0 -} diff --git a/test/Transforms/SimplifyLibCalls/FPrintF.ll b/test/Transforms/SimplifyLibCalls/FPrintF.ll deleted file mode 100644 index 51733e4a1ef6..000000000000 --- a/test/Transforms/SimplifyLibCalls/FPrintF.ll +++ /dev/null @@ -1,28 +0,0 @@ -; Test that the FPrintFOptimizer works correctly -; RUN: opt < %s -simplify-libcalls -S | \ -; RUN: not grep "call.*fprintf" - -; This transformation requires the pointer size, as it assumes that size_t is -; the size of a pointer. -target datalayout = "-p:64:64:64" - - %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [52 x i8] } - %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 } -@str = constant [3 x i8] c"%s\00" ; <[3 x i8]*> [#uses=1] -@chr = constant [3 x i8] c"%c\00" ; <[3 x i8]*> [#uses=1] -@hello = constant [13 x i8] c"hello world\0A\00" ; <[13 x i8]*> [#uses=1] -@stdout = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=3] - -declare i32 @fprintf(%struct._IO_FILE*, i8*, ...) - -define i32 @foo() { -entry: - %tmp.1 = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=1] - %tmp.0 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf( %struct._IO_FILE* %tmp.1, i8* getelementptr ([13 x i8]* @hello, i32 0, i32 0) ) ; <i32> [#uses=0] - %tmp.4 = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=1] - %tmp.3 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf( %struct._IO_FILE* %tmp.4, i8* getelementptr ([3 x i8]* @str, i32 0, i32 0), i8* getelementptr ([13 x i8]* @hello, i32 0, i32 0) ) ; <i32> [#uses=0] - %tmp.8 = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=1] - %tmp.7 = call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf( %struct._IO_FILE* %tmp.8, i8* getelementptr ([3 x i8]* @chr, i32 0, i32 0), i32 33 ) ; <i32> [#uses=0] - ret i32 0 -} - diff --git a/test/Transforms/SimplifyLibCalls/FPuts.ll b/test/Transforms/SimplifyLibCalls/FPuts.ll deleted file mode 100644 index aa01aba2656c..000000000000 --- a/test/Transforms/SimplifyLibCalls/FPuts.ll +++ /dev/null @@ -1,29 +0,0 @@ -; Test that the FPutsOptimizer works correctly -; RUN: opt < %s -simplify-libcalls -S | \ -; RUN: not grep "call.*fputs" - -; This transformation requires the pointer size, as it assumes that size_t is -; the size of a pointer. -target datalayout = "-p:64:64:64" - - %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i32, [52 x i8] } - %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 } -@stdout = external global %struct._IO_FILE* ; <%struct._IO_FILE**> [#uses=1] -@empty = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1] -@len1 = constant [2 x i8] c"A\00" ; <[2 x i8]*> [#uses=1] -@long = constant [7 x i8] c"hello\0A\00" ; <[7 x i8]*> [#uses=1] - -declare i32 @fputs(i8*, %struct._IO_FILE*) - -define i32 @main() { -entry: - %out = load %struct._IO_FILE** @stdout ; <%struct._IO_FILE*> [#uses=3] - %s1 = getelementptr [1 x i8]* @empty, i32 0, i32 0 ; <i8*> [#uses=1] - %s2 = getelementptr [2 x i8]* @len1, i32 0, i32 0 ; <i8*> [#uses=1] - %s3 = getelementptr [7 x i8]* @long, i32 0, i32 0 ; <i8*> [#uses=1] - %a = call i32 @fputs( i8* %s1, %struct._IO_FILE* %out ) ; <i32> [#uses=0] - %b = call i32 @fputs( i8* %s2, %struct._IO_FILE* %out ) ; <i32> [#uses=0] - %c = call i32 @fputs( i8* %s3, %struct._IO_FILE* %out ) ; <i32> [#uses=0] - ret i32 0 -} - diff --git a/test/Transforms/SimplifyLibCalls/IsDigit.ll b/test/Transforms/SimplifyLibCalls/IsDigit.ll deleted file mode 100644 index 51a769d9bb3d..000000000000 --- a/test/Transforms/SimplifyLibCalls/IsDigit.ll +++ /dev/null @@ -1,21 +0,0 @@ -; Test that the IsDigitOptimizer works correctly -; RUN: opt < %s -simplify-libcalls -S | \ -; RUN: not grep call - -declare i32 @isdigit(i32) - -declare i32 @isascii(i32) - -define i32 @main() { - %val1 = call i32 @isdigit( i32 47 ) ; <i32> [#uses=1] - %val2 = call i32 @isdigit( i32 48 ) ; <i32> [#uses=1] - %val3 = call i32 @isdigit( i32 57 ) ; <i32> [#uses=1] - %val4 = call i32 @isdigit( i32 58 ) ; <i32> [#uses=1] - %rslt1 = add i32 %val1, %val2 ; <i32> [#uses=1] - %rslt2 = add i32 %val3, %val4 ; <i32> [#uses=1] - %sum = add i32 %rslt1, %rslt2 ; <i32> [#uses=1] - %rslt = call i32 @isdigit( i32 %sum ) ; <i32> [#uses=1] - %tmp = call i32 @isascii( i32 %rslt ) ; <i32> [#uses=1] - ret i32 %tmp -} - diff --git a/test/Transforms/SimplifyLibCalls/Printf.ll b/test/Transforms/SimplifyLibCalls/Printf.ll deleted file mode 100644 index 489c993f2110..000000000000 --- a/test/Transforms/SimplifyLibCalls/Printf.ll +++ /dev/null @@ -1,37 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -S | FileCheck %s - -@str = internal constant [13 x i8] c"hello world\0A\00" ; <[13 x i8]*> [#uses=1] -@str1 = internal constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1] - -; CHECK: private unnamed_addr constant [12 x i8] c"hello world\00" - -declare i32 @printf(i8*, ...) - -; CHECK: define void @f0 -; CHECK-NOT: printf -; CHECK: } -define void @f0() { -entry: - %tmp1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @str, i32 0, i32 0) ) ; <i32> [#uses=0] - ret void -} - -; CHECK: define void @f1 -; CHECK-NOT: printf -; CHECK: } -define void @f1() { -entry: - %tmp1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([2 x i8]* @str1, i32 0, i32 0) ) ; <i32> [#uses=0] - ret void -} - -; Verify that we don't turn this into a putchar call (thus changing the return -; value). -; -; CHECK: define i32 @f2 -; CHECK: printf -; CHECK: } -define i32 @f2() { - %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([2 x i8]* @str1, i32 0, i32 0)) - ret i32 %call -} diff --git a/test/Transforms/SimplifyLibCalls/Puts.ll b/test/Transforms/SimplifyLibCalls/Puts.ll deleted file mode 100644 index 48431434cc61..000000000000 --- a/test/Transforms/SimplifyLibCalls/Puts.ll +++ /dev/null @@ -1,15 +0,0 @@ -; Test that the PutsOptimizer works correctly -; RUN: opt < %s -simplify-libcalls -S | FileCheck %s - -target datalayout = "-p:64:64:64" - -@.str = private constant [1 x i8] zeroinitializer - -declare i32 @puts(i8*) - -define void @foo() { -entry: -; CHECK: call i32 @putchar(i32 10) - %call = call i32 @puts(i8* getelementptr inbounds ([1 x i8]* @.str, i32 0, i32 0)) - ret void -} diff --git a/test/Transforms/SimplifyLibCalls/SPrintF.ll b/test/Transforms/SimplifyLibCalls/SPrintF.ll deleted file mode 100644 index 514a7d9f6eee..000000000000 --- a/test/Transforms/SimplifyLibCalls/SPrintF.ll +++ /dev/null @@ -1,40 +0,0 @@ -; Test that the SPrintFOptimizer works correctly -; RUN: opt < %s -simplify-libcalls -S | \ -; RUN: not grep "call.*sprintf" - -; This transformation requires the pointer size, as it assumes that size_t is -; the size of a pointer. -target datalayout = "-p:64:64:64" - -@hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=1] -@null = constant [1 x i8] zeroinitializer ; <[1 x i8]*> [#uses=1] -@null_hello = constant [7 x i8] c"\00hello\00" ; <[7 x i8]*> [#uses=1] -@fmt1 = constant [3 x i8] c"%s\00" ; <[3 x i8]*> [#uses=1] -@fmt2 = constant [3 x i8] c"%c\00" ; <[3 x i8]*> [#uses=1] - -declare i32 @sprintf(i8*, i8*, ...) - -declare i32 @puts(i8*) - -define i32 @foo(i8* %p) { - %target = alloca [1024 x i8] ; <[1024 x i8]*> [#uses=1] - %target_p = getelementptr [1024 x i8]* %target, i32 0, i32 0 ; <i8*> [#uses=7] - %hello_p = getelementptr [6 x i8]* @hello, i32 0, i32 0 ; <i8*> [#uses=2] - %null_p = getelementptr [1 x i8]* @null, i32 0, i32 0 ; <i8*> [#uses=1] - %nh_p = getelementptr [7 x i8]* @null_hello, i32 0, i32 0 ; <i8*> [#uses=1] - %fmt1_p = getelementptr [3 x i8]* @fmt1, i32 0, i32 0 ; <i8*> [#uses=2] - %fmt2_p = getelementptr [3 x i8]* @fmt2, i32 0, i32 0 ; <i8*> [#uses=1] - store i8 0, i8* %target_p - %r1 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %hello_p ) ; <i32> [#uses=1] - %r2 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %null_p ) ; <i32> [#uses=1] - %r3 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %nh_p ) ; <i32> [#uses=1] - %r4 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %fmt1_p, i8* %hello_p ) ; <i32> [#uses=1] - %r4.1 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %fmt1_p, i8* %p ) ; <i32> [#uses=1] - %r5 = call i32 (i8*, i8*, ...)* @sprintf( i8* %target_p, i8* %fmt2_p, i32 82 ) ; <i32> [#uses=1] - %r6 = add i32 %r1, %r2 ; <i32> [#uses=1] - %r7 = add i32 %r3, %r6 ; <i32> [#uses=1] - %r8 = add i32 %r5, %r7 ; <i32> [#uses=1] - %r9 = add i32 %r8, %r4 ; <i32> [#uses=1] - %r10 = add i32 %r9, %r4.1 ; <i32> [#uses=1] - ret i32 %r10 -} diff --git a/test/Transforms/SimplifyLibCalls/ToAscii.ll b/test/Transforms/SimplifyLibCalls/ToAscii.ll deleted file mode 100644 index aef47333b3c3..000000000000 --- a/test/Transforms/SimplifyLibCalls/ToAscii.ll +++ /dev/null @@ -1,21 +0,0 @@ -; Test that the ToAsciiOptimizer works correctly -; RUN: opt < %s -simplify-libcalls -S | \ -; RUN: not grep "call.*toascii" - -declare i32 @toascii(i32) - -define i32 @main() { - %val1 = call i32 @toascii( i32 1 ) ; <i32> [#uses=1] - %val2 = call i32 @toascii( i32 0 ) ; <i32> [#uses=1] - %val3 = call i32 @toascii( i32 127 ) ; <i32> [#uses=1] - %val4 = call i32 @toascii( i32 128 ) ; <i32> [#uses=1] - %val5 = call i32 @toascii( i32 255 ) ; <i32> [#uses=1] - %val6 = call i32 @toascii( i32 256 ) ; <i32> [#uses=1] - %rslt1 = add i32 %val1, %val2 ; <i32> [#uses=1] - %rslt2 = add i32 %val3, %val4 ; <i32> [#uses=1] - %rslt3 = add i32 %val5, %val6 ; <i32> [#uses=1] - %rslt4 = add i32 %rslt1, %rslt2 ; <i32> [#uses=1] - %rslt5 = add i32 %rslt4, %rslt3 ; <i32> [#uses=1] - ret i32 %rslt5 -} - diff --git a/test/Transforms/SimplifyLibCalls/abs.ll b/test/Transforms/SimplifyLibCalls/abs.ll deleted file mode 100644 index 3934a5b98f74..000000000000 --- a/test/Transforms/SimplifyLibCalls/abs.ll +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -S | grep "select i1 %ispos" -; PR2337 - -define i32 @test(i32 %x) { -entry: - %call = call i32 @abs( i32 %x ) ; <i32> [#uses=1] - ret i32 %call -} - -declare i32 @abs(i32) - diff --git a/test/Transforms/SimplifyLibCalls/cos.ll b/test/Transforms/SimplifyLibCalls/cos.ll deleted file mode 100644 index 6a8ce8c3881d..000000000000 --- a/test/Transforms/SimplifyLibCalls/cos.ll +++ /dev/null @@ -1,14 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -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-unknown-linux-gnu" - -define double @foo(double %d) nounwind readnone { -; CHECK: @foo - %1 = fsub double -0.000000e+00, %d - %2 = call double @cos(double %1) nounwind readnone -; CHECK: call double @cos(double %d) - ret double %2 -} - -declare double @cos(double) nounwind readnone diff --git a/test/Transforms/SimplifyLibCalls/debug-line.ll b/test/Transforms/SimplifyLibCalls/debug-line.ll deleted file mode 100644 index b668e4b9d342..000000000000 --- a/test/Transforms/SimplifyLibCalls/debug-line.ll +++ /dev/null @@ -1,24 +0,0 @@ -; RUN: opt -simplify-libcalls -S < %s | FileCheck %s - - -@.str = private constant [3 x i8] c"%c\00" - -define void @foo() nounwind ssp { -;CHECK: call i32 @putchar{{.+}} !dbg - %1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8]* @.str, i32 0, i32 0), i32 97), !dbg !5 - ret void, !dbg !7 -} - -declare i32 @printf(i8*, ...) - -!llvm.dbg.sp = !{!0} - -!0 = metadata !{i32 589870, i32 0, metadata !1, metadata !"foo", metadata !"foo", metadata !"", metadata !1, i32 4, metadata !3, i1 false, i1 true, i32 0, i32 0, null, i32 0, i1 false, void ()* @foo} ; [ DW_TAG_subprogram ] -!1 = metadata !{i32 589865, metadata !"m.c", metadata !"/private/tmp", metadata !2} ; [ DW_TAG_file_type ] -!2 = metadata !{i32 589841, i32 0, i32 12, metadata !"m.c", metadata !"/private/tmp", metadata !"clang", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ] -!3 = metadata !{i32 589845, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !4, i32 0, null} ; [ DW_TAG_subroutine_type ] -!4 = metadata !{null} -!5 = metadata !{i32 5, i32 2, metadata !6, null} -!6 = metadata !{i32 589835, metadata !0, i32 4, i32 12, metadata !1, i32 0} ; [ DW_TAG_lexical_block ] -!7 = metadata !{i32 6, i32 1, metadata !6, null} - diff --git a/test/Transforms/SimplifyLibCalls/double-float-shrink.ll b/test/Transforms/SimplifyLibCalls/double-float-shrink.ll deleted file mode 100644 index b4ab8b4ceb9d..000000000000 --- a/test/Transforms/SimplifyLibCalls/double-float-shrink.ll +++ /dev/null @@ -1,333 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -enable-double-float-shrink -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-unknown-linux-gnu" - -define float @acos_test(float %f) nounwind readnone { -; CHECK: acos_test - %conv = fpext float %f to double - %call = call double @acos(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @acosf(float %f) -} - -define double @acos_test2(float %f) nounwind readnone { -; CHECK: acos_test2 - %conv = fpext float %f to double - %call = call double @acos(double %conv) - ret double %call -; CHECK: call double @acos(double %conv) -} - -define float @acosh_test(float %f) nounwind readnone { -; CHECK: acosh_test - %conv = fpext float %f to double - %call = call double @acosh(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @acoshf(float %f) -} - -define double @acosh_test2(float %f) nounwind readnone { -; CHECK: acosh_test2 - %conv = fpext float %f to double - %call = call double @acosh(double %conv) - ret double %call -; CHECK: call double @acosh(double %conv) -} - -define float @asin_test(float %f) nounwind readnone { -; CHECK: asin_test - %conv = fpext float %f to double - %call = call double @asin(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @asinf(float %f) -} - -define double @asin_test2(float %f) nounwind readnone { -; CHECK: asin_test2 - %conv = fpext float %f to double - %call = call double @asin(double %conv) - ret double %call -; CHECK: call double @asin(double %conv) -} - -define float @asinh_test(float %f) nounwind readnone { -; CHECK: asinh_test - %conv = fpext float %f to double - %call = call double @asinh(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @asinhf(float %f) -} - -define double @asinh_test2(float %f) nounwind readnone { -; CHECK: asinh_test2 - %conv = fpext float %f to double - %call = call double @asinh(double %conv) - ret double %call -; CHECK: call double @asinh(double %conv) -} - -define float @atan_test(float %f) nounwind readnone { -; CHECK: atan_test - %conv = fpext float %f to double - %call = call double @atan(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @atanf(float %f) -} - -define double @atan_test2(float %f) nounwind readnone { -; CHECK: atan_test2 - %conv = fpext float %f to double - %call = call double @atan(double %conv) - ret double %call -; CHECK: call double @atan(double %conv) -} -define float @atanh_test(float %f) nounwind readnone { -; CHECK: atanh_test - %conv = fpext float %f to double - %call = call double @atanh(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @atanhf(float %f) -} - -define double @atanh_test2(float %f) nounwind readnone { -; CHECK: atanh_test2 - %conv = fpext float %f to double - %call = call double @atanh(double %conv) - ret double %call -; CHECK: call double @atanh(double %conv) -} -define float @cbrt_test(float %f) nounwind readnone { -; CHECK: cbrt_test - %conv = fpext float %f to double - %call = call double @cbrt(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @cbrtf(float %f) -} - -define double @cbrt_test2(float %f) nounwind readnone { -; CHECK: cbrt_test2 - %conv = fpext float %f to double - %call = call double @cbrt(double %conv) - ret double %call -; CHECK: call double @cbrt(double %conv) -} -define float @exp_test(float %f) nounwind readnone { -; CHECK: exp_test - %conv = fpext float %f to double - %call = call double @exp(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @expf(float %f) -} - -define double @exp_test2(float %f) nounwind readnone { -; CHECK: exp_test2 - %conv = fpext float %f to double - %call = call double @exp(double %conv) - ret double %call -; CHECK: call double @exp(double %conv) -} -define float @expm1_test(float %f) nounwind readnone { -; CHECK: expm1_test - %conv = fpext float %f to double - %call = call double @expm1(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @expm1f(float %f) -} - -define double @expm1_test2(float %f) nounwind readnone { -; CHECK: expm1_test2 - %conv = fpext float %f to double - %call = call double @expm1(double %conv) - ret double %call -; CHECK: call double @expm1(double %conv) -} -define float @exp10_test(float %f) nounwind readnone { -; CHECK: exp10_test - %conv = fpext float %f to double - %call = call double @exp10(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @exp10f(float %f) -} - -define double @exp10_test2(float %f) nounwind readnone { -; CHECK: exp10_test2 - %conv = fpext float %f to double - %call = call double @exp10(double %conv) - ret double %call -; CHECK: call double @exp10(double %conv) -} -define float @log_test(float %f) nounwind readnone { -; CHECK: log_test - %conv = fpext float %f to double - %call = call double @log(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @logf(float %f) -} - -define double @log_test2(float %f) nounwind readnone { -; CHECK: log_test2 - %conv = fpext float %f to double - %call = call double @log(double %conv) - ret double %call -; CHECK: call double @log(double %conv) -} -define float @log10_test(float %f) nounwind readnone { -; CHECK: log10_test - %conv = fpext float %f to double - %call = call double @log10(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @log10f(float %f) -} - -define double @log10_test2(float %f) nounwind readnone { -; CHECK: log10_test2 - %conv = fpext float %f to double - %call = call double @log10(double %conv) - ret double %call -; CHECK: call double @log10(double %conv) -} -define float @log1p_test(float %f) nounwind readnone { -; CHECK: log1p_test - %conv = fpext float %f to double - %call = call double @log1p(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @log1pf(float %f) -} - -define double @log1p_test2(float %f) nounwind readnone { -; CHECK: log1p_test2 - %conv = fpext float %f to double - %call = call double @log1p(double %conv) - ret double %call -; CHECK: call double @log1p(double %conv) -} -define float @log2_test(float %f) nounwind readnone { -; CHECK: log2_test - %conv = fpext float %f to double - %call = call double @log2(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @log2f(float %f) -} - -define double @log2_test2(float %f) nounwind readnone { -; CHECK: log2_test2 - %conv = fpext float %f to double - %call = call double @log2(double %conv) - ret double %call -; CHECK: call double @log2(double %conv) -} -define float @logb_test(float %f) nounwind readnone { -; CHECK: logb_test - %conv = fpext float %f to double - %call = call double @logb(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @logbf(float %f) -} - -define double @logb_test2(float %f) nounwind readnone { -; CHECK: logb_test2 - %conv = fpext float %f to double - %call = call double @logb(double %conv) - ret double %call -; CHECK: call double @logb(double %conv) -} -define float @sin_test(float %f) nounwind readnone { -; CHECK: sin_test - %conv = fpext float %f to double - %call = call double @sin(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @sinf(float %f) -} - -define double @sin_test2(float %f) nounwind readnone { -; CHECK: sin_test2 - %conv = fpext float %f to double - %call = call double @sin(double %conv) - ret double %call -; CHECK: call double @sin(double %conv) -} -define float @sqrt_test(float %f) nounwind readnone { -; CHECK: sqrt_test - %conv = fpext float %f to double - %call = call double @sqrt(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @sqrtf(float %f) -} - -define double @sqrt_test2(float %f) nounwind readnone { -; CHECK: sqrt_test2 - %conv = fpext float %f to double - %call = call double @sqrt(double %conv) - ret double %call -; CHECK: call double @sqrt(double %conv) -} -define float @tan_test(float %f) nounwind readnone { -; CHECK: tan_test - %conv = fpext float %f to double - %call = call double @tan(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @tanf(float %f) -} - -define double @tan_test2(float %f) nounwind readnone { -; CHECK: tan_test2 - %conv = fpext float %f to double - %call = call double @tan(double %conv) - ret double %call -; CHECK: call double @tan(double %conv) -} -define float @tanh_test(float %f) nounwind readnone { -; CHECK: tanh_test - %conv = fpext float %f to double - %call = call double @tanh(double %conv) - %conv1 = fptrunc double %call to float - ret float %conv1 -; CHECK: call float @tanhf(float %f) -} - -define double @tanh_test2(float %f) nounwind readnone { -; CHECK: tanh_test2 - %conv = fpext float %f to double - %call = call double @tanh(double %conv) - ret double %call -; CHECK: call double @tanh(double %conv) -} - -declare double @tanh(double) nounwind readnone -declare double @tan(double) nounwind readnone -declare double @sqrt(double) nounwind readnone -declare double @sin(double) nounwind readnone -declare double @log2(double) nounwind readnone -declare double @log1p(double) nounwind readnone -declare double @log10(double) nounwind readnone -declare double @log(double) nounwind readnone -declare double @logb(double) nounwind readnone -declare double @exp10(double) nounwind readnone -declare double @expm1(double) nounwind readnone -declare double @exp(double) nounwind readnone -declare double @cbrt(double) nounwind readnone -declare double @atanh(double) nounwind readnone -declare double @atan(double) nounwind readnone -declare double @acos(double) nounwind readnone -declare double @acosh(double) nounwind readnone -declare double @asin(double) nounwind readnone -declare double @asinh(double) nounwind readnone diff --git a/test/Transforms/SimplifyLibCalls/exp2.ll b/test/Transforms/SimplifyLibCalls/exp2.ll deleted file mode 100644 index a5927757cf93..000000000000 --- a/test/Transforms/SimplifyLibCalls/exp2.ll +++ /dev/null @@ -1,38 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -S | grep "call.*ldexp" | count 4 -; rdar://5852514 - -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin8" - -define double @t1(i32 %x) nounwind { -entry: - %tmp12 = sitofp i32 %x to double ; <double> [#uses=1] - %exp2 = tail call double @exp2( double %tmp12 ) ; <double> [#uses=1] - ret double %exp2 -} - -define float @t4(i8 zeroext %x) nounwind { -entry: - %tmp12 = uitofp i8 %x to float ; <float> [#uses=1] - %tmp3 = tail call float @exp2f( float %tmp12 ) nounwind readonly ; <float> [#uses=1] - ret float %tmp3 -} - -declare float @exp2f(float) nounwind readonly - -define double @t3(i16 zeroext %x) nounwind { -entry: - %tmp12 = uitofp i16 %x to double ; <double> [#uses=1] - %exp2 = tail call double @exp2( double %tmp12 ) ; <double> [#uses=1] - ret double %exp2 -} - -define double @t2(i16 signext %x) nounwind { -entry: - %tmp12 = sitofp i16 %x to double ; <double> [#uses=1] - %exp2 = tail call double @exp2( double %tmp12 ) ; <double> [#uses=1] - ret double %exp2 -} - -declare double @exp2(double) - diff --git a/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll b/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll index aecb887beb3a..ad54c3e38f13 100644 --- a/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll +++ b/test/Transforms/SimplifyLibCalls/float-shrink-compare.ll @@ -1,4 +1,4 @@ -; RUN: opt -S -simplify-libcalls -instcombine %s | FileCheck %s +; 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" diff --git a/test/Transforms/SimplifyLibCalls/floor.ll b/test/Transforms/SimplifyLibCalls/floor.ll deleted file mode 100644 index 93c62c20023d..000000000000 --- a/test/Transforms/SimplifyLibCalls/floor.ll +++ /dev/null @@ -1,85 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-linux" | FileCheck -check-prefix=DO-SIMPLIFY %s -; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-win32" | FileCheck -check-prefix=DONT-SIMPLIFY %s -; RUN: opt < %s -simplify-libcalls -S -mtriple "x86_64-pc-win32" | FileCheck -check-prefix=C89-SIMPLIFY %s -; RUN: opt < %s -simplify-libcalls -S -mtriple "i386-pc-mingw32" | FileCheck -check-prefix=DO-SIMPLIFY %s -; RUN: opt < %s -simplify-libcalls -S -mtriple "x86_64-pc-mingw32" | FileCheck -check-prefix=DO-SIMPLIFY %s -; RUN: opt < %s -simplify-libcalls -S -mtriple "sparc-sun-solaris" | FileCheck -check-prefix=DO-SIMPLIFY %s - -; DO-SIMPLIFY: call float @floorf( -; DO-SIMPLIFY: call float @ceilf( -; DO-SIMPLIFY: call float @roundf( -; DO-SIMPLIFY: call float @nearbyintf( -; DO-SIMPLIFY: call float @truncf( -; DO-SIMPLIFY: call float @fabsf( - -; C89-SIMPLIFY: call float @floorf( -; C89-SIMPLIFY: call float @ceilf( -; C89-SIMPLIFY: call double @round( -; C89-SIMPLIFY: call double @nearbyint( - -; DONT-SIMPLIFY: call double @floor( -; DONT-SIMPLIFY: call double @ceil( -; DONT-SIMPLIFY: call double @round( -; DONT-SIMPLIFY: call double @nearbyint( -; DONT-SIMPLIFY: call double @trunc( -; DONT-SIMPLIFY: call double @fabs( - -declare double @floor(double) - -declare double @ceil(double) - -declare double @round(double) - -declare double @nearbyint(double) - -declare double @trunc(double) - -declare double @fabs(double) - -define float @test_floor(float %C) { - %D = fpext float %C to double ; <double> [#uses=1] - ; --> floorf - %E = call double @floor( double %D ) ; <double> [#uses=1] - %F = fptrunc double %E to float ; <float> [#uses=1] - ret float %F -} - -define float @test_ceil(float %C) { - %D = fpext float %C to double ; <double> [#uses=1] - ; --> ceilf - %E = call double @ceil( double %D ) ; <double> [#uses=1] - %F = fptrunc double %E to float ; <float> [#uses=1] - ret float %F -} - -define float @test_round(float %C) { - %D = fpext float %C to double ; <double> [#uses=1] - ; --> roundf - %E = call double @round( double %D ) ; <double> [#uses=1] - %F = fptrunc double %E to float ; <float> [#uses=1] - ret float %F -} - -define float @test_nearbyint(float %C) { - %D = fpext float %C to double ; <double> [#uses=1] - ; --> nearbyintf - %E = call double @nearbyint( double %D ) ; <double> [#uses=1] - %F = fptrunc double %E to float ; <float> [#uses=1] - ret float %F -} - -define float @test_trunc(float %C) { - %D = fpext float %C to double - ; --> truncf - %E = call double @trunc(double %D) - %F = fptrunc double %E to float - ret float %F -} - -define float @test_fabs(float %C) { - %D = fpext float %C to double - ; --> fabsf - %E = call double @fabs(double %D) - %F = fptrunc double %E to float - ret float %F -} diff --git a/test/Transforms/SimplifyLibCalls/fwrite.ll b/test/Transforms/SimplifyLibCalls/fwrite.ll deleted file mode 100644 index f0f3dcaac63e..000000000000 --- a/test/Transforms/SimplifyLibCalls/fwrite.ll +++ /dev/null @@ -1,13 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -S | FileCheck %s - -%FILE = type { i32 } - -@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 - -define i64 @foo(%FILE* %f) { -; CHECK: %retval = call i64 @fwrite - %retval = call i64 @fwrite(i8* getelementptr inbounds ([1 x i8]* @.str, i64 0, i64 0), i64 1, i64 1, %FILE* %f) - ret i64 %retval -} - -declare i64 @fwrite(i8*, i64, i64, %FILE *) diff --git a/test/Transforms/SimplifyLibCalls/iprintf.ll b/test/Transforms/SimplifyLibCalls/iprintf.ll deleted file mode 100644 index 7f036fe3ab8b..000000000000 --- a/test/Transforms/SimplifyLibCalls/iprintf.ll +++ /dev/null @@ -1,71 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -S -o %t -; RUN: FileCheck < %t %s -target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32" -target triple = "xcore-xmos-elf" - -@.str = internal constant [4 x i8] c"%f\0A\00" ; <[4 x i8]*> [#uses=1] -@.str1 = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] - -; Verify printf with no floating point arguments is transformed to iprintf -define i32 @f0(i32 %x) nounwind { -entry: -; CHECK: define i32 @f0 -; CHECK: @iprintf -; CHECK: } - %0 = tail call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @.str1, i32 0, i32 0), i32 %x) ; <i32> [#uses=0] - ret i32 %0 -} - -; Verify we don't turn this into an iprintf call -define void @f1(double %x) nounwind { -entry: -; CHECK: define void @f1 -; CHECK: @printf -; CHECK: } - %0 = tail call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), double %x) nounwind ; <i32> [#uses=0] - ret void -} - -; Verify sprintf with no floating point arguments is transformed to siprintf -define i32 @f2(i8* %p, i32 %x) nounwind { -entry: -; CHECK: define i32 @f2 -; CHECK: @siprintf -; CHECK: } - %0 = tail call i32 (i8*, i8*, ...)* @sprintf(i8 *%p, i8* getelementptr ([4 x i8]* @.str1, i32 0, i32 0), i32 %x) - ret i32 %0 -} - -; Verify we don't turn this into an siprintf call -define i32 @f3(i8* %p, double %x) nounwind { -entry: -; CHECK: define i32 @f3 -; CHECK: @sprintf -; CHECK: } - %0 = tail call i32 (i8*, i8*, ...)* @sprintf(i8 *%p, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), double %x) - ret i32 %0 -} - -; Verify fprintf with no floating point arguments is transformed to fiprintf -define i32 @f4(i8* %p, i32 %x) nounwind { -entry: -; CHECK: define i32 @f4 -; CHECK: @fiprintf -; CHECK: } - %0 = tail call i32 (i8*, i8*, ...)* @fprintf(i8 *%p, i8* getelementptr ([4 x i8]* @.str1, i32 0, i32 0), i32 %x) - ret i32 %0 -} - -; Verify we don't turn this into an fiprintf call -define i32 @f5(i8* %p, double %x) nounwind { -entry: -; CHECK: define i32 @f5 -; CHECK: @fprintf -; CHECK: } - %0 = tail call i32 (i8*, i8*, ...)* @fprintf(i8 *%p, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), double %x) - ret i32 %0 -} - -declare i32 @printf(i8* nocapture, ...) nounwind -declare i32 @sprintf(i8* nocapture, i8* nocapture, ...) nounwind -declare i32 @fprintf(i8* nocapture, i8* nocapture, ...) nounwind diff --git a/test/Transforms/SimplifyLibCalls/osx-names.ll b/test/Transforms/SimplifyLibCalls/osx-names.ll deleted file mode 100644 index e321d1dd3171..000000000000 --- a/test/Transforms/SimplifyLibCalls/osx-names.ll +++ /dev/null @@ -1,30 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -S | FileCheck %s -; <rdar://problem/9815881> -; On OSX x86-32, fwrite and fputs aren't called fwrite and fputs. -; Make sure we use the correct names. - -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128" -target triple = "i386-apple-macosx10.7.2" - -%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, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } -%struct.__sbuf = type { i8*, i32 } -%struct.__sFILEX = type opaque - -@.str = private unnamed_addr constant [13 x i8] c"Hello world\0A\00", align 1 -@.str2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 - -define void @test1(%struct.__sFILE* %stream) nounwind { -; CHECK: define void @test1 -; CHECK: call i32 @"fwrite$UNIX2003" - %call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([13 x i8]* @.str, i32 0, i32 0)) nounwind - ret void -} - -define void @test2(%struct.__sFILE* %stream, i8* %str) nounwind ssp { -; CHECK: define void @test2 -; CHECK: call i32 @"fputs$UNIX2003" - %call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([3 x i8]* @.str2, i32 0, i32 0), i8* %str) nounwind - ret void -} - -declare i32 @fprintf(%struct.__sFILE*, i8*, ...) nounwind diff --git a/test/Transforms/SimplifyLibCalls/pow-to-sqrt.ll b/test/Transforms/SimplifyLibCalls/pow-to-sqrt.ll deleted file mode 100644 index 0480fdda8916..000000000000 --- a/test/Transforms/SimplifyLibCalls/pow-to-sqrt.ll +++ /dev/null @@ -1,33 +0,0 @@ -; RUN: opt < %s -simplify-libcalls -S | FileCheck %s -; rdar://7251832 - -; SimplifyLibcalls should optimize pow(x, 0.5) to sqrt plus code to handle -; special cases. The readonly attribute on the call should be preserved. - -; CHECK: define float @foo(float %x) nounwind { -; CHECK: %sqrtf = call float @sqrtf(float %x) nounwind readonly -; CHECK: %fabsf = call float @fabsf(float %sqrtf) nounwind readonly -; CHECK: %1 = fcmp oeq float %x, 0xFFF0000000000000 -; CHECK: %retval = select i1 %1, float 0x7FF0000000000000, float %fabsf -; CHECK: ret float %retval - -define float @foo(float %x) nounwind { - %retval = call float @powf(float %x, float 0.5) - ret float %retval -} - -; CHECK: define double @doo(double %x) nounwind { -; CHECK: %sqrt = call double @sqrt(double %x) nounwind readonly -; CHECK: %fabs = call double @fabs(double %sqrt) nounwind readonly -; CHECK: %1 = fcmp oeq double %x, 0xFFF0000000000000 -; CHECK: %retval = select i1 %1, double 0x7FF0000000000000, double %fabs -; CHECK: ret double %retval -; CHECK: } - -define double @doo(double %x) nounwind { - %retval = call double @pow(double %x, double 0.5) - ret double %retval -} - -declare float @powf(float, float) nounwind readonly -declare double @pow(double, double) nounwind readonly diff --git a/test/Transforms/SimplifyLibCalls/pow2.ll b/test/Transforms/SimplifyLibCalls/pow2.ll deleted file mode 100644 index f0964e7d6daa..000000000000 --- a/test/Transforms/SimplifyLibCalls/pow2.ll +++ /dev/null @@ -1,37 +0,0 @@ -; Testcase for calls to the standard C "pow" function -; -; RUN: opt < %s -simplify-libcalls -S | not grep "call .pow" - - -declare double @pow(double, double) -declare float @powf(float, float) - -define double @test1(double %X) { - %Y = call double @pow( double %X, double 0.000000e+00 ) ; <double> [#uses=1] - ret double %Y -} - -define double @test2(double %X) { - %Y = call double @pow( double %X, double -0.000000e+00 ) ; <double> [#uses=1] - ret double %Y -} - -define double @test3(double %X) { - %Y = call double @pow( double 1.000000e+00, double %X ) ; <double> [#uses=1] - ret double %Y -} - -define double @test4(double %X) { - %Y = call double @pow( double %X, double 2.0) - ret double %Y -} - -define float @test4f(float %X) { - %Y = call float @powf( float %X, float 2.0) - ret float %Y -} - -define float @test5f(float %X) { - %Y = call float @powf(float 2.0, float %X) ;; exp2 - ret float %Y -} |