summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-12-28 23:24:21 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-12-28 23:24:21 +0000
commit4c378a4453fcd4374c1142a729710f18a61b15e2 (patch)
treeb4afb4daf42d291c376da255b91a1bdf16f7f97a /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
parent6c4bd806fae3d64976fa8d4936fa91aa9d940111 (diff)
downloadbcm5719-llvm-4c378a4453fcd4374c1142a729710f18a61b15e2.tar.gz
bcm5719-llvm-4c378a4453fcd4374c1142a729710f18a61b15e2.zip
Change CaptureTracking to pass a Use* instead of a Value* when a value is
captured. This allows the tracker to look at the specific use, which may be especially interesting for function calls. Use this to fix 'nocapture' deduction in FunctionAttrs. The existing one does not iterate until a fixpoint and does not guarantee that it produces the same result regardless of iteration order. The new implementation builds up a graph of how arguments are passed from function to function, and uses a bottom-up walk on the argument-SCCs to assign nocapture. This gets us nocapture more often, and does so rather efficiently and independent of iteration order. llvm-svn: 147327
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 704e27b5ce6..53d666078ed 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -349,7 +349,8 @@ namespace {
return true;
}
- bool captured(Instruction *I) {
+ bool captured(Use *U) {
+ Instruction *I = cast<Instruction>(U->getUser());
if (BeforeHere != I && DT->dominates(BeforeHere, I))
return false;
Captured = true;
OpenPOWER on IntegriCloud