[PATCH] D153305: [MemoryEffects][NFCI] Make the MemoryEffects class reusable
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 20 00:53:01 PDT 2023
nikic added a comment.
Looks reasonable. A bit unfortunate to lose the ability to forward declare.
================
Comment at: llvm/include/llvm/Support/ModRef.h:58
-/// Summary of how a function affects memory in the program.
-///
-/// Loads from constant globals are not considered memory accesses for this
-/// interface. Also, functions may freely modify stack space local to their
-/// invocation without having to report it through these interfaces.
-class MemoryEffects {
+class IRMemoryEffects {
public:
----------------
Why the enum wrapped in a class here?
================
Comment at: llvm/include/llvm/Support/ModRef.h:224
bool onlyAccessesInaccessibleOrArgMem() const {
- return isNoModRef(getModRef(Other));
+ return isNoModRef(getModRef(Location::Other));
}
----------------
This function assumes that there are only three locations. You need to make it `getWithoutLoc(Location::InaccessibleMem).getWithoutLoc(Location::ArgMem).doesNotAccessMemory()` to gracefully handle extra locations.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153305/new/
https://reviews.llvm.org/D153305
More information about the llvm-commits
mailing list