aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/AddReadAttrs.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-12-29 20:51:17 +0000
committerDuncan Sands <baldrick@free.fr>2008-12-29 20:51:17 +0000
commit2964fe37aee3696e887dc50f52926df3ba51f4c7 (patch)
tree4d985be2fbb48559262ee194fa6dc90c11d28739 /lib/Transforms/IPO/AddReadAttrs.cpp
parente9dd47afa6c539a8fbe25a2f12c508a4aae5105c (diff)
Experiments show that looking through phi nodes
and select instructions doesn't buy anything here except extra complexity: the only difference in the entire testsuite was that a readonly function became readnone in MiBench/consumer-typeset. Add a comment about this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/AddReadAttrs.cpp')
-rw-r--r--lib/Transforms/IPO/AddReadAttrs.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/AddReadAttrs.cpp b/lib/Transforms/IPO/AddReadAttrs.cpp
index 2835d5e9f3..96c1427e0e 100644
--- a/lib/Transforms/IPO/AddReadAttrs.cpp
+++ b/lib/Transforms/IPO/AddReadAttrs.cpp
@@ -64,6 +64,8 @@ bool AddReadAttrs::PointsToLocalMemory(Value *V) {
// A global constant counts as local memory for our purposes.
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
return GV->isConstant();
+ // Could look through phi nodes and selects here, but it doesn't seem
+ // to be useful in practice.
return false;
}