summaryrefslogtreecommitdiff
path: root/test/Transforms/LICM
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-11-23 19:30:27 +0000
committerDuncan Sands <baldrick@free.fr>2007-11-23 19:30:27 +0000
commite4dc717585d5b891d187248352cbbc8d2438da96 (patch)
treed4334227cc13a82e2ae1f1cb6a4b834f96b0c3f6 /test/Transforms/LICM
parentbb65098d2c8c08e1c45d5567c07f492e2a770aff (diff)
downloadllvm-e4dc717585d5b891d187248352cbbc8d2438da96.tar.gz
llvm-e4dc717585d5b891d187248352cbbc8d2438da96.tar.bz2
llvm-e4dc717585d5b891d187248352cbbc8d2438da96.tar.xz
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/Transforms/LICM')
-rw-r--r--test/Transforms/LICM/call_sink_const_function.ll21
-rw-r--r--test/Transforms/LICM/call_sink_pure_function.ll20
2 files changed, 22 insertions, 19 deletions
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
}