[clang] [llvm] [AArch64] Add support for range prefetch intrinsic (PR #170490)

Kerry McLaughlin via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 19 05:36:03 PST 2025


================
@@ -6701,6 +6701,38 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
           "isdata argument to llvm.aarch64.prefetch must be 0 or 1", Call);
     break;
   }
+  case Intrinsic::aarch64_range_prefetch_reg: {
+    Check(cast<ConstantInt>(Call.getArgOperand(1))->getZExtValue() < 2,
+          "write argument to llvm.aarch64.range.prefetch.reg must be 0 or 1",
+          Call);
+    Check(cast<ConstantInt>(Call.getArgOperand(2))->getZExtValue() < 2,
+          "stream argument to llvm.aarch64.range.prefetch.reg must be 0 or 1",
+          Call);
+    break;
+  }
+  case Intrinsic::aarch64_range_prefetch_imm: {
+    Check(cast<ConstantInt>(Call.getArgOperand(1))->getZExtValue() < 2,
+          "write argument to llvm.aarch64.range.prefetch.imm must be 0 or 1",
+          Call);
+    Check(cast<ConstantInt>(Call.getArgOperand(2))->getZExtValue() < 2,
+          "stream argument to llvm.aarch64.range.prefetch.imm must be 0 or 1",
+          Call);
+    int Length = cast<ConstantInt>(Call.getArgOperand(3))->getZExtValue();
+    Check(Length > -2049 && Length < 2041,
+          "length argument to llvm.aarch64.range.prefetch.imm must be -2048 - "
+          "2040",
+          Call);
----------------
kmclaughlin-arm wrote:

These checks have been removed along with the `_imm` intrinsic, but I've fixed the ranges for stride & length. 

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


More information about the llvm-commits mailing list