diff options
author | Anders Carlsson <andersca@mac.com> | 2011-03-23 15:51:12 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-03-23 15:51:12 +0000 |
commit | c4f0ab397c395b851a0304c31bc48759e010777b (patch) | |
tree | 9a7e573f0f1039bb059db1aca4683e5a9020f7e2 /llvm/lib/Analysis/BasicAliasAnalysis.cpp | |
parent | 899b68fdf5536ba6b45941dd385d96dda563a4d1 (diff) | |
download | bcm5719-llvm-c4f0ab397c395b851a0304c31bc48759e010777b.tar.gz bcm5719-llvm-c4f0ab397c395b851a0304c31bc48759e010777b.zip |
Revert r128140 for now.
llvm-svn: 128149
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index e807933aaaf..f7bcd9ec44d 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -57,29 +57,6 @@ static bool isKnownNonNull(const Value *V) { return false; } -/// areAllUsesInOneFunction - Return true if all the uses of the given value -/// are in the same function. Note that this returns false if any of the uses -/// are from non-instruction values. -static bool areAllUsesInOneFunction(const Value *V) { - const llvm::Function *Fn = 0; - - for (Value::const_use_iterator UI = V->use_begin(), E = V->use_end(); - UI != E; ++UI) { - if (const Instruction *I = dyn_cast<Instruction>(*UI)) { - if (!Fn) { - Fn = I->getParent()->getParent(); - continue; - } - - if (Fn != I->getParent()->getParent()) - return false; - } else - return false; - } - - return true; -} - /// isNonEscapingLocalObject - Return true if the pointer is to a function-local /// object that never escapes from the function. static bool isNonEscapingLocalObject(const Value *V) { @@ -102,16 +79,6 @@ static bool isNonEscapingLocalObject(const Value *V) { return true; return !PointerMayBeCaptured(V, false, /*StoreCaptures=*/true); } - - // If this is an internal global variable that's only used in this function, - // check if it escapes the function. - if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) { - if (GV->hasInternalLinkage() && areAllUsesInOneFunction(GV)) { - return !PointerMayBeCaptured(V, /*ReturnCaptures=*/true, - /*StoreCaptures=*/true); - } - } - return false; } |