[llvm] [TableGen] Ignore inaccessible memory when checking pattern flags (PR #90061)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 06:47:03 PDT 2024


================
@@ -3616,7 +3616,15 @@ class InstAnalyzer {
       hasChain = true;
 
     if (const CodeGenIntrinsic *IntInfo = N.getIntrinsicInfo(CDP)) {
-      ModRefInfo MR = IntInfo->ME.getModRef();
+      // Ignore reads/writes to inaccessible memory. These should not imply
+      // mayLoad/mayStore on the instruction because they are often used to
+      // model dependencies that Machine IR expresses as uses/defs of a
+      // special physical register.
+      ModRefInfo MR = ModRefInfo::NoModRef;
+      for (MemoryEffects::Location Loc : MemoryEffects::locations()) {
+        if (Loc != MemoryEffects::Location::InaccessibleMem)
+          MR |= IntInfo->ME.getModRef();
----------------
jayfoad wrote:

Silly typo here. It should have been:
```suggestion
          MR |= IntInfo->ME.getModRef(Loc);
```
Because of this the patch had no effect, and if I fix the typo then it causes some build failures.

I will revert and rethink.

https://github.com/llvm/llvm-project/pull/90061


More information about the llvm-commits mailing list