Add a new pass AddReadAttrs which works out which functions
can get the readnone/readonly attributes, and gives them it.
The plan is to remove markmodref (which did the same thing
by querying GlobalsModRef) and delete the analogous
functionality from GlobalsModRef.
llvm-svn: 56341
diff --git a/llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadNone.ll b/llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadNone.ll
deleted file mode 100644
index b286ada..0000000
--- a/llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadNone.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -markmodref | llvm-dis | grep readnone | count 2
-
-define i32 @f() {
-entry:
- %tmp = call i32 @e( ) ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-declare i32 @e() readnone
diff --git a/llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadOnly.ll b/llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadOnly.ll
deleted file mode 100644
index de1666f..0000000
--- a/llvm/test/Analysis/GlobalsModRef/2008-09-03-ReadOnly.ll
+++ /dev/null
@@ -1,9 +0,0 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -markmodref | llvm-dis | grep readonly | count 2
-
-define i32 @f() {
-entry:
- %tmp = call i32 @e( ) ; <i32> [#uses=1]
- ret i32 %tmp
-}
-
-declare i32 @e() readonly
diff --git a/llvm/test/Analysis/GlobalsModRef/2008-09-03-Mutual.ll b/llvm/test/Transforms/AddReadAttrs/2008-09-03-Mutual.ll
similarity index 64%
rename from llvm/test/Analysis/GlobalsModRef/2008-09-03-Mutual.ll
rename to llvm/test/Transforms/AddReadAttrs/2008-09-03-Mutual.ll
index f6f47f9..0a4f085 100644
--- a/llvm/test/Analysis/GlobalsModRef/2008-09-03-Mutual.ll
+++ b/llvm/test/Transforms/AddReadAttrs/2008-09-03-Mutual.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -markmodref | llvm-dis | grep readnone
+; RUN: llvm-as < %s | opt -addreadattrs | llvm-dis | grep readnone
define i32 @a() {
%tmp = call i32 @b( ) ; <i32> [#uses=1]
diff --git a/llvm/test/Transforms/AddReadAttrs/2008-09-03-ReadNone.ll b/llvm/test/Transforms/AddReadAttrs/2008-09-03-ReadNone.ll
new file mode 100644
index 0000000..3271902
--- /dev/null
+++ b/llvm/test/Transforms/AddReadAttrs/2008-09-03-ReadNone.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | opt -addreadattrs | llvm-dis | grep readnone | count 2
+
+define i32 @f() {
+entry:
+ %tmp = call i32 @e( ) ; <i32> [#uses=1]
+ ret i32 %tmp
+}
+
+declare i32 @e() readnone
diff --git a/llvm/test/Transforms/AddReadAttrs/2008-09-03-ReadOnly.ll b/llvm/test/Transforms/AddReadAttrs/2008-09-03-ReadOnly.ll
new file mode 100644
index 0000000..c08e7b1
--- /dev/null
+++ b/llvm/test/Transforms/AddReadAttrs/2008-09-03-ReadOnly.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | opt -addreadattrs | llvm-dis | grep readonly | count 2
+
+define i32 @f() {
+entry:
+ %tmp = call i32 @e( ) ; <i32> [#uses=1]
+ ret i32 %tmp
+}
+
+declare i32 @e() readonly
diff --git a/llvm/test/Analysis/GlobalsModRef/2008-09-13-VolatileRead.ll b/llvm/test/Transforms/AddReadAttrs/2008-09-13-VolatileRead.ll
similarity index 60%
rename from llvm/test/Analysis/GlobalsModRef/2008-09-13-VolatileRead.ll
rename to llvm/test/Transforms/AddReadAttrs/2008-09-13-VolatileRead.ll
index 8ac9637..0690083 100644
--- a/llvm/test/Analysis/GlobalsModRef/2008-09-13-VolatileRead.ll
+++ b/llvm/test/Transforms/AddReadAttrs/2008-09-13-VolatileRead.ll
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | opt -globalsmodref-aa -markmodref | llvm-dis | not grep read
+; RUN: llvm-as < %s | opt -addreadattrs | llvm-dis | not grep read
; PR2792
@g = global i32 0 ; <i32*> [#uses=1]