summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-11-19 21:57:48 +0000
committerDan Gohman <gohman@apple.com>2009-11-19 21:57:48 +0000
commit94e617627d06af901a12526a176cbfb67835e6d9 (patch)
tree68b59578330dbad228e938b3367a198d2b22a3a4 /llvm/lib/Transforms/IPO/FunctionAttrs.cpp
parentb6c7704a8df88e8b4e975af7e52b78c198e72daf (diff)
downloadbcm5719-llvm-94e617627d06af901a12526a176cbfb67835e6d9.tar.gz
bcm5719-llvm-94e617627d06af901a12526a176cbfb67835e6d9.zip
Extend CaptureTracking to indicate when a value is never stored, even
if it is not ultimately captured. Teach BasicAliasAnalysis that a local object address which does not escape and is never stored does not alias with a value resulting from a load. llvm-svn: 89398
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionAttrs.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
index b3a832f12d0..a16d335ef50 100644
--- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -212,7 +212,7 @@ bool FunctionAttrs::AddNoCaptureAttrs(const std::vector<CallGraphNode *> &SCC) {
for (Function::arg_iterator A = F->arg_begin(), E = F->arg_end(); A!=E; ++A)
if (isa<PointerType>(A->getType()) && !A->hasNoCaptureAttr() &&
- !PointerMayBeCaptured(A, true)) {
+ !PointerMayBeCaptured(A, true, /*StoreCaptures=*/false)) {
A->addAttr(Attribute::NoCapture);
++NumNoCapture;
Changed = true;
@@ -280,7 +280,7 @@ bool FunctionAttrs::IsFunctionMallocLike(Function *F,
return false; // Did not come from an allocation.
}
- if (PointerMayBeCaptured(RetVal, false))
+ if (PointerMayBeCaptured(RetVal, false, /*StoreCaptures=*/false))
return false;
}
OpenPOWER on IntegriCloud