[llvm-commits] [llvm] r128149 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/non-escaping-local-object.ll
Anders Carlsson
andersca at mac.com
Wed Mar 23 08:51:12 PDT 2011
Author: andersca
Date: Wed Mar 23 10:51:12 2011
New Revision: 128149
URL: http://llvm.org/viewvc/llvm-project?rev=128149&view=rev
Log:
Revert r128140 for now.
Removed:
llvm/trunk/test/Analysis/BasicAA/non-escaping-local-object.ll
Modified:
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=128149&r1=128148&r2=128149&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Mar 23 10:51:12 2011
@@ -57,29 +57,6 @@
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 @@
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;
}
Removed: llvm/trunk/test/Analysis/BasicAA/non-escaping-local-object.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/non-escaping-local-object.ll?rev=128148&view=auto
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/non-escaping-local-object.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/non-escaping-local-object.ll (removed)
@@ -1,19 +0,0 @@
-; RUN: opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output < %s |& FileCheck %s
-
- at global = internal global i32 0
-
-declare void @should_not_be_called()
-declare i32 @f()
-
-; CHECK: Function: g: 2 pointers, 0 call sites
-define void @g(i32* nocapture %p) {
- store i32 0, i32* @global
-
- ; @global is internal, is only used in this function, and never has its
- ; address taken so it can't alias p.
- ; CHECK: NoAlias: i32* %p, i32* @global
- store i32 1, i32* %p
- %1 = load i32* @global
- ret void
-}
-
More information about the llvm-commits
mailing list