aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-11-19 21:41:51 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-11-19 21:45:52 +0100
commit393b9e9db31a3f83bc8b813ee24b56bc8ed93a49 (patch)
treeef1547f24269afb12b3cd9f71e7b716b3aecb6f8 /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
parentb0750e2df6e4d5251c67f74265edbc753c76afc2 (diff)
downloadllvm-393b9e9db31a3f83bc8b813ee24b56bc8ed93a49.tar.gz
llvm-393b9e9db31a3f83bc8b813ee24b56bc8ed93a49.tar.bz2
llvm-393b9e9db31a3f83bc8b813ee24b56bc8ed93a49.zip
[MemLoc] Require LocationSize argument (NFC)
When constructing a MemoryLocation by hand, require that a LocationSize is explicitly specified. D91649 will split up LocationSize::unknown() into two different states, and callers should make an explicit choice regarding the kind of MemoryLocation they want to have.
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index a19c1d78526b..ab0105906682 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -148,7 +148,7 @@ static ModRefInfo GetLocation(const Instruction *Inst, MemoryLocation &Loc,
if (const CallInst *CI = isFreeCall(Inst, &TLI)) {
// calls to free() deallocate the entire structure
- Loc = MemoryLocation(CI->getArgOperand(0));
+ Loc = MemoryLocation(CI->getArgOperand(0), LocationSize::unknown());
return ModRefInfo::Mod;
}
@@ -450,14 +450,16 @@ MemDepResult MemoryDependenceResults::getSimplePointerDependencyFrom(
// because the value is undefined.
Intrinsic::ID ID = II->getIntrinsicID();
switch (ID) {
- case Intrinsic::lifetime_start:
+ case Intrinsic::lifetime_start: {
// FIXME: This only considers queries directly on the invariant-tagged
// pointer, not on query pointers that are indexed off of them. It'd
// be nice to handle that at some point (the right approach is to use
// GetPointerBaseWithConstantOffset).
- if (BatchAA.isMustAlias(MemoryLocation(II->getArgOperand(1)), MemLoc))
+ MemoryLocation ArgLoc(II->getArgOperand(1), LocationSize::unknown());
+ if (BatchAA.isMustAlias(ArgLoc, MemLoc))
return MemDepResult::getDef(II);
continue;
+ }
case Intrinsic::masked_load:
case Intrinsic::masked_store: {
MemoryLocation Loc;