aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/MemoryLocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/MemoryLocation.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryLocation.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/MemoryLocation.cpp b/llvm/lib/Analysis/MemoryLocation.cpp
index 3b42bb4..c8daab7a 100644
--- a/llvm/lib/Analysis/MemoryLocation.cpp
+++ b/llvm/lib/Analysis/MemoryLocation.cpp
@@ -111,7 +111,9 @@ MemoryLocation MemoryLocation::getForDest(const AnyMemIntrinsic *MI) {
std::optional<MemoryLocation>
MemoryLocation::getForDest(const CallBase *CB, const TargetLibraryInfo &TLI) {
- if (!CB->onlyAccessesArgMemory())
+ // Check that the only possible writes are to arguments.
+ MemoryEffects WriteME = CB->getMemoryEffects() & MemoryEffects::writeOnly();
+ if (!WriteME.onlyAccessesArgPointees())
return std::nullopt;
if (CB->hasOperandBundles())