diff options
author | Meador Inge <meadori@codesourcery.com> | 2012-11-26 20:37:20 +0000 |
---|---|---|
committer | Meador Inge <meadori@codesourcery.com> | 2012-11-26 20:37:20 +0000 |
commit | d7aa3231f75174810a3443e6c2e1993ddefc1dd2 (patch) | |
tree | ac4db0bb411570b2b99618e56c52f76bcea1f256 /test/Transforms/SimplifyLibCalls/iprintf.ll | |
parent | 22689b6034dbde1c08e39b162fd59e1fd5d35b96 (diff) | |
download | external_llvm-d7aa3231f75174810a3443e6c2e1993ddefc1dd2.tar.gz external_llvm-d7aa3231f75174810a3443e6c2e1993ddefc1dd2.tar.bz2 external_llvm-d7aa3231f75174810a3443e6c2e1993ddefc1dd2.zip |
instcombine: Migrate printf optimizations
This patch migrates the printf optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SimplifyLibCalls/iprintf.ll')
-rw-r--r-- | test/Transforms/SimplifyLibCalls/iprintf.ll | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/test/Transforms/SimplifyLibCalls/iprintf.ll b/test/Transforms/SimplifyLibCalls/iprintf.ll index 7f036fe3ab..d6a7074db1 100644 --- a/test/Transforms/SimplifyLibCalls/iprintf.ll +++ b/test/Transforms/SimplifyLibCalls/iprintf.ll @@ -6,26 +6,6 @@ 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: @@ -66,6 +46,5 @@ entry: 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 |