[clang] [llvm] [mlir] [LLVM] Improve IR parsing and printing for target memory locations (PR #176968)

Antonio Frighetto via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 21 03:37:52 PST 2026


================
@@ -2614,9 +2628,19 @@ std::optional<MemoryEffects> LLParser::parseMemoryAttr() {
     }
 
     Lex.Lex();
-    if (Loc) {
+    if (Locs) {
       SeenLoc = true;
-      ME = ME.getWithModRef(*Loc, *MR);
+      for (IRMemLocation Loc : *Locs) {
+        ME = ME.getWithModRef(Loc, *MR);
+        SeenTargetLoc = (ME.isTargetMemLoc(Loc) && Locs->size() == 1)
+                            ? true
+                            : SeenTargetLoc;
----------------
antoniofrighetto wrote:

```suggestion
        if (ME.isTargetMemLoc(Loc) && Locs->size() == 1)
            SeenTargetLoc = true;
```

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


More information about the cfe-commits mailing list