aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff options
context:
space:
mode:
authorEvgeniy Brevnov <ybrevnov@azul.com>2022-01-24 16:29:46 +0700
committerEvgeniy Brevnov <ybrevnov@azul.com>2022-01-25 10:15:23 +0700
commit0e55d4fab0183b6dca82ce127b78ded3db918c27 (patch)
tree2ec75040400744537fea0a16b5fb6b780f5eb75d /llvm/lib/Analysis/BasicAliasAnalysis.cpp
parent9ea3dfa5d015f61ff282ed88d08125bb38fd19a8 (diff)
downloadllvm-0e55d4fab0183b6dca82ce127b78ded3db918c27.zip
llvm-0e55d4fab0183b6dca82ce127b78ded3db918c27.tar.gz
llvm-0e55d4fab0183b6dca82ce127b78ded3db918c27.tar.bz2
[AA] Refine ModRefInfo for llvm.memcpy.* in presence of operand bundles
Presence of operand bundles changes semantics in respect to ModRef. In particular, spec says: "From the compilers perspective, deoptimization operand bundles make the call sites theyre attached to at least readonly. They read through all of their pointer typed operands (even if theyre not otherwise escaped) and the entire visible heap. Deoptimization operand bundles do not capture their operands except during deoptimization, in which case control will not be returned to the compiled frame". Fix handling of llvm.memcpy.* according to the spec. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D118033
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index fa9ccb0..b4c9859 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -1020,9 +1020,9 @@ ModRefInfo BasicAAResult::getModRefInfo(const CallBase *Call,
getBestAAResults().alias(MemoryLocation::getForDest(Inst), Loc, AAQI);
// It's also possible for Loc to alias both src and dest, or neither.
ModRefInfo rv = ModRefInfo::NoModRef;
- if (SrcAA != AliasResult::NoAlias)
+ if (SrcAA != AliasResult::NoAlias || Call->hasReadingOperandBundles())
rv = setRef(rv);
- if (DestAA != AliasResult::NoAlias)
+ if (DestAA != AliasResult::NoAlias || Call->hasClobberingOperandBundles())
rv = setMod(rv);
return rv;
}