summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-05-06 08:42:00 +0000
committerDuncan Sands <baldrick@free.fr>2009-05-06 08:42:00 +0000
commit9759f2e063abd306c22c84cc3200e9e653b59194 (patch)
treec307af976791ad9fbbedf027278646b8b22d6abe /llvm/lib/Transforms
parentc98868136f2d166f8eb9c52706d51f91ba479abd (diff)
downloadbcm5719-llvm-9759f2e063abd306c22c84cc3200e9e653b59194.tar.gz
bcm5719-llvm-9759f2e063abd306c22c84cc3200e9e653b59194.zip
Fix PR3754: don't mark functions that wrap MallocInst with
the readnone. Since MallocInst is scheduled for deletion it doesn't seem worth doing anything more subtle, such as having mayWriteToMemory return true for MallocInst. llvm-svn: 71077
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionAttrs.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
index 65faef32e5e..e8315247b23 100644
--- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -152,6 +152,11 @@ bool FunctionAttrs::AddReadAttrs(const std::vector<CallGraphNode *> &SCC) {
if (I->mayWriteToMemory())
// Writes memory. Just give up.
return false;
+
+ if (isa<MallocInst>(I))
+ // MallocInst claims not to write memory! PR3754.
+ return false;
+
// If this instruction may read memory, remember that.
ReadsMemory |= I->mayReadFromMemory();
}
OpenPOWER on IntegriCloud