[llvm] [LFI][AArch64] Add rewrites for memory accesses (PR #195167)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 10:11:36 PDT 2026


================
@@ -64,6 +66,97 @@ static bool isPrivilegedTPAccess(const MCInst &Inst) {
   return false;
 }
 
+// Instructions that have mayLoad/mayStore set in TableGen but don't actually
+// perform memory accesses.
+static bool isNotMemAccess(const MCInst &Inst) {
+  switch (Inst.getOpcode()) {
+  case AArch64::DMB:
+  case AArch64::DSB:
+  case AArch64::ISB:
+  case AArch64::HINT:
+    return true;
+  default:
+    return false;
+  }
+}
+
+static bool mayPrefetch(const MCInst &Inst) {
+  switch (Inst.getOpcode()) {
+  case AArch64::PRFMl:
+  case AArch64::PRFMroW:
+  case AArch64::PRFMroX:
+  case AArch64::PRFMui:
+  case AArch64::PRFUMi:
+    return true;
----------------
smithp35 wrote:

I think it will be worth a comment at the start of the file that the classification functions are limited to Armv8.1-A.

For example there's RPRFM and the SVE prefetch instructions, but these are outside the scope of what LFI supports.  

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


More information about the llvm-commits mailing list