[llvm] [AArch64][Bitcode] Use target memory for SME state (PR #205829)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 06:03:25 PDT 2026


================
@@ -2470,12 +2472,29 @@ Error BitcodeReader::parseAttributeGroupBlock() {
                         MemoryEffects::argMemOnly(ArgMem) |
                         MemoryEffects::errnoMemOnly(OtherMem) |
                         MemoryEffects::otherMemOnly(OtherMem);
+              // Old versions dont have target memory location.
+              // It was represented as Inaccessible memory for AArch64.
+              if (BitcodeTargetTriple.isAArch64())
+                ME = ME.getWithModRef(IRMemLocation::TargetMem0,
+                                      InaccessibleMem) |
+                     ME.getWithModRef(IRMemLocation::TargetMem1,
+                                      InaccessibleMem);
               B.addMemoryAttr(ME);
             } else {
               // Construct the memory attribute directly from the encoded base
               // on newer versions.
-              B.addMemoryAttr(MemoryEffects::createFromIntValue(
-                  EncodedME & 0x00FFFFFFFFFFFFFFULL));
+              auto ME = MemoryEffects::createFromIntValue(
+                  EncodedME & 0x00FFFFFFFFFFFFFFULL);
+              // Only from Version=2 onwards target memory location exist.
+              // It was represented as Inaccessible memory for AArch64.
----------------
antoniofrighetto wrote:

```suggestion
              // Only from version 2 onwards target memory location exists.
              // It was represented as inaccessible memory for AArch64.
```

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


More information about the llvm-commits mailing list