diff options
author | Duncan Sands <baldrick@free.fr> | 2007-11-23 19:30:27 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-11-23 19:30:27 +0000 |
commit | e4dc717585d5b891d187248352cbbc8d2438da96 (patch) | |
tree | d4334227cc13a82e2ae1f1cb6a4b834f96b0c3f6 /test | |
parent | bb65098d2c8c08e1c45d5567c07f492e2a770aff (diff) |
Ding dong, the DoesntAccessMemoryFns and
OnlyReadsMemoryFns tables are dead! We
get more, and more accurate, information
from gcc via the readnone and readonly
function attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44288 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Analysis/GlobalsModRef/chaining-analysis.ll | 24 | ||||
-rw-r--r-- | test/Analysis/LoadVN/call_cse.ll | 19 | ||||
-rw-r--r-- | test/Analysis/LoadVN/call_pure_function.ll | 21 | ||||
-rw-r--r-- | test/Transforms/ADCE/dce_pure_call.ll | 9 | ||||
-rw-r--r-- | test/Transforms/LICM/call_sink_const_function.ll | 21 | ||||
-rw-r--r-- | test/Transforms/LICM/call_sink_pure_function.ll | 20 | ||||
-rw-r--r-- | test/Transforms/LoopRotate/pr1154.ll | 49 |
7 files changed, 83 insertions, 80 deletions
diff --git a/test/Analysis/GlobalsModRef/chaining-analysis.ll b/test/Analysis/GlobalsModRef/chaining-analysis.ll index 49244563c0..e521cc1350 100644 --- a/test/Analysis/GlobalsModRef/chaining-analysis.ll +++ b/test/Analysis/GlobalsModRef/chaining-analysis.ll @@ -1,20 +1,20 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -globalsmodref-aa -load-vn -gcse | llvm-dis | not grep load +; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse | llvm-dis | not grep load -; This test requires the use of previous analyses to determine that +; This test requires the use of previous analyses to determine that ; doesnotmodX does not modify X (because 'sin' doesn't). -%X = internal global int 4 +@X = internal global i32 4 ; <i32*> [#uses=2] -declare double %sin(double) +declare double @sin(double) readnone -int %test(int *%P) { - store int 12, int* %X - call double %doesnotmodX(double 1.0) - %V = load int* %X - ret int %V +define i32 @test(i32* %P) { + store i32 12, i32* @X + call double @doesnotmodX( double 1.000000e+00 ) ; <double>:1 [#uses=0] + %V = load i32* @X ; <i32> [#uses=1] + ret i32 %V } -double %doesnotmodX(double %V) { - %V2 = call double %sin(double %V) - ret double %V2 +define double @doesnotmodX(double %V) { + %V2 = call double @sin( double %V ) readnone ; <double> [#uses=1] + ret double %V2 } diff --git a/test/Analysis/LoadVN/call_cse.ll b/test/Analysis/LoadVN/call_cse.ll index 78cdd43051..b62300f5ab 100644 --- a/test/Analysis/LoadVN/call_cse.ll +++ b/test/Analysis/LoadVN/call_cse.ll @@ -1,11 +1,12 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub -declare int %strlen(sbyte*) +; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub -int %test(sbyte* %P) { - %X = call int %strlen(sbyte* %P) - %A = add int %X, 14 - %Y = call int %strlen(sbyte* %P) - %Z = sub int %X, %Y - %B = add int %A, %Z - ret int %B +declare i32 @strlen(i8*) readonly + +define i32 @test(i8* %P) { + %X = call i32 @strlen( i8* %P ) readonly ; <i32> [#uses=2] + %A = add i32 %X, 14 ; <i32> [#uses=1] + %Y = call i32 @strlen( i8* %P ) readonly ; <i32> [#uses=1] + %Z = sub i32 %X, %Y ; <i32> [#uses=1] + %B = add i32 %A, %Z ; <i32> [#uses=1] + ret i32 %B } diff --git a/test/Analysis/LoadVN/call_pure_function.ll b/test/Analysis/LoadVN/call_pure_function.ll index 302ae60466..8055c5271f 100644 --- a/test/Analysis/LoadVN/call_pure_function.ll +++ b/test/Analysis/LoadVN/call_pure_function.ll @@ -1,13 +1,14 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub -declare int %strlen(sbyte*) -declare void %use(int %X) +; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep sub -sbyte %test(sbyte* %P, sbyte* %Q) { - %A = load sbyte* %Q - %X = call int %strlen(sbyte* %P) - %B = load sbyte* %Q ;; CSE with A. - call void %use(int %X) ;; make strlen not dead +declare i32 @strlen(i8*) readonly - %C = sub sbyte %A, %B - ret sbyte %C +declare void @use(i32) + +define i8 @test(i8* %P, i8* %Q) { + %A = load i8* %Q ; <i8> [#uses=1] + %X = call i32 @strlen( i8* %P ) readonly ; <i32> [#uses=1] + %B = load i8* %Q ; <i8> [#uses=1] + call void @use( i32 %X ) + %C = sub i8 %A, %B ; <i8> [#uses=1] + ret i8 %C } diff --git a/test/Transforms/ADCE/dce_pure_call.ll b/test/Transforms/ADCE/dce_pure_call.ll index 79a360c268..a7414e027e 100644 --- a/test/Transforms/ADCE/dce_pure_call.ll +++ b/test/Transforms/ADCE/dce_pure_call.ll @@ -1,9 +1,8 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -adce | llvm-dis | not grep call +; RUN: llvm-as < %s | opt -adce | llvm-dis | not grep call -declare int %strlen(sbyte*) +declare i32 @strlen(i8*) readonly -void %test() { - ;; Dead call should be deleted! - call int %strlen(sbyte *null) +define void @test() { + call i32 @strlen( i8* null ) readonly ; <i32>:1 [#uses=0] ret void } diff --git a/test/Transforms/LICM/call_sink_const_function.ll b/test/Transforms/LICM/call_sink_const_function.ll index a8a4b72d6d..f187e27335 100644 --- a/test/Transforms/LICM/call_sink_const_function.ll +++ b/test/Transforms/LICM/call_sink_const_function.ll @@ -1,16 +1,17 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -licm | llvm-dis | %prcontext sin 1 | grep Out: -declare double %sin(double) -declare void %foo() +; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | %prcontext sin 1 | grep Out: -double %test(double %X) { - br label %Loop +declare double @sin(double) readnone + +declare void @foo() -Loop: - call void %foo() ;; Unknown effects! +define double @test(double %X) { + br label %Loop - %A = call double %sin(double %X) ;; Can still hoist/sink call - br bool true, label %Loop, label %Out +Loop: ; preds = %Loop, %0 + call void @foo( ) + %A = call double @sin( double %X ) readnone ; <double> [#uses=1] + br i1 true, label %Loop, label %Out -Out: +Out: ; preds = %Loop ret double %A } diff --git a/test/Transforms/LICM/call_sink_pure_function.ll b/test/Transforms/LICM/call_sink_pure_function.ll index e5857a62a6..c0457a17fc 100644 --- a/test/Transforms/LICM/call_sink_pure_function.ll +++ b/test/Transforms/LICM/call_sink_pure_function.ll @@ -1,14 +1,16 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -basicaa -licm | llvm-dis | %prcontext strlen 1 | grep Out: -declare int %strlen(sbyte*) -declare void %foo() +; RUN: llvm-as < %s | opt -basicaa -licm | llvm-dis | %prcontext strlen 1 | grep Out: -int %test(sbyte* %P) { +declare i32 @strlen(i8*) readonly + +declare void @foo() + +define i32 @test(i8* %P) { br label %Loop -Loop: - %A = call int %strlen(sbyte* %P) ;; Can hoist/sink call - br bool false, label %Loop, label %Out +Loop: ; preds = %Loop, %0 + %A = call i32 @strlen( i8* %P ) readonly ; <i32> [#uses=1] + br i1 false, label %Loop, label %Out -Out: - ret int %A +Out: ; preds = %Loop + ret i32 %A } diff --git a/test/Transforms/LoopRotate/pr1154.ll b/test/Transforms/LoopRotate/pr1154.ll index 09c940548f..025bc5694b 100644 --- a/test/Transforms/LoopRotate/pr1154.ll +++ b/test/Transforms/LoopRotate/pr1154.ll @@ -1,13 +1,12 @@ -; RUN: llvm-upgrade < %s | llvm-as | opt -std-compile-opts | llvm-dis | \ +; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis | \ ; RUN: %prcontext strstr 2 | grep -v declare | grep bb36.outer: -; END. @str = internal constant [68 x i8] c"Dot. date. datum. 123. Some more doubtful demonstration dummy data.\00" ; <[68 x i8]*> [#uses=1] @str1 = internal constant [5 x i8] c"ummy\00" ; <[5 x i8]*> [#uses=1] @str2 = internal constant [6 x i8] c" data\00" ; <[6 x i8]*> [#uses=1] @str3 = internal constant [3 x i8] c"by\00" ; <[3 x i8]*> [#uses=1] -i32 @stringSearch_Clib(i32 %count) { +define i32 @stringSearch_Clib(i32 %count) { entry: %count_addr = alloca i32 ; <i32*> [#uses=2] %retval = alloca i32, align 4 ; <i32*> [#uses=2] @@ -17,11 +16,11 @@ entry: %j = alloca i32, align 4 ; <i32*> [#uses=4] %p = alloca i8*, align 4 ; <i8**> [#uses=6] %b = alloca [68 x i8], align 16 ; <[68 x i8]*> [#uses=6] - "alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] + %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] store i32 %count, i32* %count_addr store i32 0, i32* %c %b1 = bitcast [68 x i8]* %b to i8* ; <i8*> [#uses=1] - %tmp2 = getelementptr [68 x i8]* @str, i32 0, i32 0 ; <i8*> [#uses=1] + %tmp2 = getelementptr [68 x i8]* @str, i64 0, i64 0 ; <i8*> [#uses=1] call void @llvm.memcpy.i32( i8* %b1, i8* %tmp2, i32 68, i32 1 ) store i32 0, i32* %j br label %bb41 @@ -34,13 +33,13 @@ bb: ; preds = %bb41 bb4: ; preds = %bb36 %b5 = bitcast [68 x i8]* %b to i8* ; <i8*> [#uses=1] - %tmp6 = getelementptr [5 x i8]* @str1, i32 0, i32 0 ; <i8*> [#uses=1] - %tmp7 = call i8* @strstr( i8* %b5, i8* %tmp6 ) ; <i8*> [#uses=1] + %tmp6 = getelementptr [5 x i8]* @str1, i64 0, i64 0 ; <i8*> [#uses=1] + %tmp7 = call i8* @strstr( i8* %b5, i8* %tmp6 ) readonly ; <i8*> [#uses=1] store i8* %tmp7, i8** %p %tmp8 = load i8** %p ; <i8*> [#uses=1] - %ttmp8 = icmp ne i8* %tmp8, null ; <i1>:0 [#uses=1] - %ttmp10 = zext i1 %ttmp8 to i8 ; <i8>:1 [#uses=1] - %ttmp7 = icmp ne i8 %ttmp10, 0 ; <i1>:2 [#uses=1] + %ttmp8 = icmp ne i8* %tmp8, null ; <i1> [#uses=1] + %ttmp10 = zext i1 %ttmp8 to i8 ; <i8> [#uses=1] + %ttmp7 = icmp ne i8 %ttmp10, 0 ; <i1> [#uses=1] br i1 %ttmp7, label %cond_true, label %cond_next cond_true: ; preds = %bb4 @@ -56,13 +55,13 @@ cond_true: ; preds = %bb4 cond_next: ; preds = %cond_true, %bb4 %b16 = bitcast [68 x i8]* %b to i8* ; <i8*> [#uses=1] - %tmp17 = getelementptr [6 x i8]* @str2, i32 0, i32 0 ; <i8*> [#uses=1] - %tmp18 = call i8* @strstr( i8* %b16, i8* %tmp17 ) ; <i8*> [#uses=1] + %tmp17 = getelementptr [6 x i8]* @str2, i64 0, i64 0 ; <i8*> [#uses=1] + %tmp18 = call i8* @strstr( i8* %b16, i8* %tmp17 ) readonly ; <i8*> [#uses=1] store i8* %tmp18, i8** %p %tmp19 = load i8** %p ; <i8*> [#uses=1] - %ttmp6 = icmp ne i8* %tmp19, null ; <i1>:3 [#uses=1] - %ttmp9 = zext i1 %ttmp6 to i8 ; <i8>:4 [#uses=1] - %ttmp4 = icmp ne i8 %ttmp9, 0 ; <i1>:5 [#uses=1] + %ttmp6 = icmp ne i8* %tmp19, null ; <i1> [#uses=1] + %ttmp9 = zext i1 %ttmp6 to i8 ; <i8> [#uses=1] + %ttmp4 = icmp ne i8 %ttmp9, 0 ; <i1> [#uses=1] br i1 %ttmp4, label %cond_true20, label %cond_next28 cond_true20: ; preds = %cond_next @@ -78,8 +77,8 @@ cond_true20: ; preds = %cond_next cond_next28: ; preds = %cond_true20, %cond_next %b29 = bitcast [68 x i8]* %b to i8* ; <i8*> [#uses=1] - %tmp30 = getelementptr [3 x i8]* @str3, i32 0, i32 0 ; <i8*> [#uses=1] - %tmp31 = call i32 @strcspn( i8* %b29, i8* %tmp30 ) ; <i32> [#uses=1] + %tmp30 = getelementptr [3 x i8]* @str3, i64 0, i64 0 ; <i8*> [#uses=1] + %tmp31 = call i32 @strcspn( i8* %b29, i8* %tmp30 ) readonly ; <i32> [#uses=1] %tmp32 = load i32* %c ; <i32> [#uses=1] %tmp33 = add i32 %tmp31, %tmp32 ; <i32> [#uses=1] store i32 %tmp33, i32* %c @@ -90,9 +89,9 @@ cond_next28: ; preds = %cond_true20, %cond_next bb36: ; preds = %cond_next28, %bb %tmp37 = load i32* %i ; <i32> [#uses=1] - %ttmp3= icmp sle i32 %tmp37, 249 ; <i1>:6 [#uses=1] - %ttmp12 = zext i1 %ttmp3 to i8 ; <i8>:7 [#uses=1] - %ttmp1 = icmp ne i8 %ttmp12, 0 ; <i1>:8 [#uses=1] + %ttmp3 = icmp sle i32 %tmp37, 249 ; <i1> [#uses=1] + %ttmp12 = zext i1 %ttmp3 to i8 ; <i8> [#uses=1] + %ttmp1 = icmp ne i8 %ttmp12, 0 ; <i1> [#uses=1] br i1 %ttmp1, label %bb4, label %bb38 bb38: ; preds = %bb36 @@ -104,9 +103,9 @@ bb38: ; preds = %bb36 bb41: ; preds = %bb38, %entry %tmp42 = load i32* %j ; <i32> [#uses=1] %tmp43 = load i32* %count_addr ; <i32> [#uses=1] - %ttmp2 = icmp slt i32 %tmp42, %tmp43 ; <i1>:9 [#uses=1] - %ttmp11 = zext i1 %ttmp2 to i8 ; <i8>:10 [#uses=1] - %ttmp5 = icmp ne i8 %ttmp11, 0 ; <i1>:11 [#uses=1] + %ttmp2 = icmp slt i32 %tmp42, %tmp43 ; <i1> [#uses=1] + %ttmp11 = zext i1 %ttmp2 to i8 ; <i8> [#uses=1] + %ttmp5 = icmp ne i8 %ttmp11, 0 ; <i1> [#uses=1] br i1 %ttmp5, label %bb, label %bb44 bb44: ; preds = %bb41 @@ -123,6 +122,6 @@ return: ; preds = %bb44 declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) -declare i8* @strstr(i8*, i8*) +declare i8* @strstr(i8*, i8*) readonly -declare i32 @strcspn(i8*, i8*) +declare i32 @strcspn(i8*, i8*) readonly |