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/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