summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-08-13 23:03:43 +0000
committerNadav Rotem <nrotem@apple.com>2012-08-13 23:03:43 +0000
commit5d4e20587494c6e90e1f606ce8859a1c793ad37c (patch)
treefeb5e2a34de969e22f24c2af7041d4b8fc983d8d /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
parentb4e1ba7191bcf2d2e2d8a2e3ae5b251890bf375f (diff)
downloadbcm5719-llvm-5d4e20587494c6e90e1f606ce8859a1c793ad37c.tar.gz
bcm5719-llvm-5d4e20587494c6e90e1f606ce8859a1c793ad37c.zip
MemoryDependenceAnalysis attempts to find the first memory dependency for function calls.
Currently, if GetLocation reports that it did not find a valid pointer (this is the case for volatile load/stores), we ignore the result. This patch adds code to handle the cases where we did not obtain a valid pointer. rdar://11872864 PR12899 llvm-svn: 161802
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 7fb154d68a2..059e57493b9 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -227,13 +227,18 @@ getCallSiteDependencyFrom(CallSite CS, bool isReadOnlyCall,
// Otherwise if the two calls don't interact (e.g. InstCS is readnone)
// keep scanning.
- break;
+ continue;
default:
return MemDepResult::getClobber(Inst);
}
}
+
+ // If we could not obtain a pointer for the instruction and the instruction
+ // touches memory then assume that this is a dependency.
+ if (MR != AliasAnalysis::NoModRef)
+ return MemDepResult::getClobber(Inst);
}
-
+
// No dependence found. If this is the entry block of the function, it is
// unknown, otherwise it is non-local.
if (BB != &BB->getParent()->getEntryBlock())
OpenPOWER on IntegriCloud