aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/GlobalsModRef.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-12-23 09:58:46 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-12-23 09:58:46 +0000
commit2bc253847095bfa2676c05df6a5243d08af84ca4 (patch)
tree4af061543e535cbcb947b585ab48f8893c79fcf3 /llvm/lib/Analysis/GlobalsModRef.cpp
parent63ad9e054316550005ce9b5073e85f6e22f29801 (diff)
downloadllvm-2bc253847095bfa2676c05df6a5243d08af84ca4.zip
llvm-2bc253847095bfa2676c05df6a5243d08af84ca4.tar.gz
llvm-2bc253847095bfa2676c05df6a5243d08af84ca4.tar.bz2
[OperandBundles] Have GlobalsModRef play nice with operand bundles
A call site's use of a Value might not correspond to an argument operand but to a bundle operand. llvm-svn: 256329
Diffstat (limited to 'llvm/lib/Analysis/GlobalsModRef.cpp')
-rw-r--r--llvm/lib/Analysis/GlobalsModRef.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp
index 51a83d5..ab2263a 100644
--- a/llvm/lib/Analysis/GlobalsModRef.cpp
+++ b/llvm/lib/Analysis/GlobalsModRef.cpp
@@ -353,12 +353,12 @@ bool GlobalsAAResult::AnalyzeUsesOfPointer(Value *V,
} else if (auto CS = CallSite(I)) {
// Make sure that this is just the function being called, not that it is
// passing into the function.
- if (!CS.isCallee(&U)) {
+ if (CS.isDataOperand(&U)) {
// Detect calls to free.
- if (isFreeCall(I, &TLI)) {
+ if (CS.isArgOperand(&U) && isFreeCall(I, &TLI)) {
if (Writers)
Writers->insert(CS->getParent()->getParent());
- } else if (CS.doesNotCapture(CS.getArgumentNo(&U))) {
+ } else if (CS.doesNotCapture(CS.getDataOperandNo(&U))) {
Function *ParentF = CS->getParent()->getParent();
// A nocapture argument may be read from or written to, but does not
// escape unless the call can somehow recurse.