diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-01-03 17:05:32 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-01-03 17:05:32 +0000 |
commit | d5c91b461a0fbd306afee8b85f81d5af95de59b7 (patch) | |
tree | e17ff5bca4b81017f0d566649f06e9e397f95e3d /lib/Transforms/IPO | |
parent | 673814be8e818a091dc7c5a01564c1c3c6cc189d (diff) | |
download | external_llvm-d5c91b461a0fbd306afee8b85f81d5af95de59b7.zip external_llvm-d5c91b461a0fbd306afee8b85f81d5af95de59b7.tar.gz external_llvm-d5c91b461a0fbd306afee8b85f81d5af95de59b7.tar.bz2 |
Any void readonly functions are provably dead, don't waste time adding
nocapture attributes to them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61610 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r-- | lib/Transforms/IPO/FunctionAttrs.cpp | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index aea4cb4..453b3c5 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -307,20 +307,6 @@ bool FunctionAttrs::AddNoCaptureAttrs(const std::vector<CallGraphNode *> &SCC) { // External node - skip it; continue; - // If the function is readonly and doesn't return any value, we know that - // the pointer value is not captured. Mark all of its pointer arguments - // nocapture. - if (F->onlyReadsMemory() && F->getReturnType() == Type::VoidTy) { - for (Function::arg_iterator A = F->arg_begin(), E = F->arg_end(); - A != E; ++A) - if (isa<PointerType>(A->getType()) && !A->hasNoCaptureAttr()) { - A->addAttr(Attribute::NoCapture); - ++NumNoCapture; - Changed = true; - } - continue; - } - // Definitions with weak linkage may be overridden at linktime with // something that writes memory, so treat them like declarations. if (F->isDeclaration() || F->mayBeOverridden()) |