[llvm] [MemorySSA] Clarify `getClobberingMemoryAccess(MA, Loc)` does not accept MemoryUse (NFC) (PR #212512)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 2 23:56:13 PDT 2026
https://github.com/antoniofrighetto updated https://github.com/llvm/llvm-project/pull/212512
>From 876853605ac2f965e6e241e136a55e57785c86d2 Mon Sep 17 00:00:00 2001
From: Antonio Frighetto <me at antoniofrighetto.com>
Date: Tue, 28 Jul 2026 16:29:15 +0200
Subject: [PATCH 1/2] [MemorySSA] Clarify `getClobberingMemoryAccess(MA, Loc)`
overload does not accept MemoryUse (NFC)
Outdated comment has been updated to match the implementation,
which asserts on MemoryUse.
---
llvm/include/llvm/Analysis/MemorySSA.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h
index b95a8d0a80e9f..c8be7fd689418 100644
--- a/llvm/include/llvm/Analysis/MemorySSA.h
+++ b/llvm/include/llvm/Analysis/MemorySSA.h
@@ -1050,11 +1050,11 @@ class MemorySSAWalker {
///
/// This version of the function is mainly used to disambiguate phi translated
/// pointers, where the value of a pointer may have changed from the initial
- /// memory access. Note that this expects to be handed either a MemoryUse,
- /// or an already potentially clobbering access. Unlike the above API, if
- /// given a MemoryDef that clobbers the pointer as the starting access, it
- /// will return that MemoryDef, whereas the above would return the clobber
- /// starting from the use side of the memory def.
+ /// memory access. Note that this expects to be handed a potentially
+ /// clobbering access (either a MemoryDef or a MemoryPhi). Unlike the above
+ /// API, if given a MemoryDef that clobbers the pointer as the starting
+ /// access, it will return that MemoryDef, whereas the above would return the
+ /// clobber starting from the use side of the memory def.
virtual MemoryAccess *getClobberingMemoryAccess(MemoryAccess *,
const MemoryLocation &,
BatchAAResults &AA) = 0;
>From 94caab9b15e2129a1887b4e7d61eb43449e652cd Mon Sep 17 00:00:00 2001
From: Antonio Frighetto <me at antoniofrighetto.com>
Date: Mon, 3 Aug 2026 08:55:32 +0200
Subject: [PATCH 2/2] !fixup remove whitespace
---
llvm/include/llvm/Analysis/MemorySSA.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h
index c8be7fd689418..14b49648fcc7a 100644
--- a/llvm/include/llvm/Analysis/MemorySSA.h
+++ b/llvm/include/llvm/Analysis/MemorySSA.h
@@ -1054,7 +1054,7 @@ class MemorySSAWalker {
/// clobbering access (either a MemoryDef or a MemoryPhi). Unlike the above
/// API, if given a MemoryDef that clobbers the pointer as the starting
/// access, it will return that MemoryDef, whereas the above would return the
- /// clobber starting from the use side of the memory def.
+ /// clobber starting from the use side of the memory def.
virtual MemoryAccess *getClobberingMemoryAccess(MemoryAccess *,
const MemoryLocation &,
BatchAAResults &AA) = 0;
More information about the llvm-commits
mailing list