[llvm] Extend MemoryEffects to Support Target-Specific Memory Locations (PR #148650)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 09:23:12 PDT 2025


================
@@ -449,6 +461,21 @@ void CodeGenIntrinsic::setProperty(const Record *R) {
   }
 }
 
+llvm::IRMemLocation
+CodeGenIntrinsic::getLocationTypeAsInt(const Record *R,
+                                       StringRef FieldName) const {
+  const Record *LocRec = R->getValueAsDef(FieldName);
+  StringRef Name = LocRec->getName();
+  if (Name == "TargetMem0")
+    return IRMemLocation::TargetMem0;
+  else if (Name == "TargetMem1")
+    return IRMemLocation::TargetMem1;
+  else if (Name == "InaccessibleMem")
+    return llvm::IRMemLocation::InaccessibleMem;
+  else
----------------
paulwalker-arm wrote:

Perhaps use a StringSwitch here that defaults to Other, with Other triggering the call to PrintFatalError.

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


More information about the llvm-commits mailing list