[clang] [llvm] [RISCV] Added the MIPS prefetch extensions for MIPS RV64 P8700. (PR #145647)
Min-Yih Hsu via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 26 18:13:17 PDT 2025
================
@@ -0,0 +1,32 @@
+; RUN: llc -mtriple=riscv32 -mattr=+xmipscbop -mattr=+m -verify-machineinstrs < %s \
+; RUN: | FileCheck %s -check-prefix=RV32XMIPSPREFETCH
+; RUN: llc -mtriple=riscv64 -mattr=+xmipscbop -mattr=+m -verify-machineinstrs < %s \
+; RUN: | FileCheck %s -check-prefix=RV64XMIPSPREFETCH
+
+define void @prefetch_read(ptr noundef %ptr) nounwind {
+; RV32XMIPSPREFETCH-LABEL: prefetch_read:
+; RV32XMIPSPREFETCH: mips.pref 8, 1(a0)
+;
+; RV64XMIPSPREFETCH-LABEL: prefetch_read:
+; RV64XMIPSPREFETCH: mips.pref 8, 1(a0)
+entry:
+ %arrayidx = getelementptr inbounds nuw i8, ptr %ptr, i64 1
+ tail call void @llvm.prefetch.p0(ptr nonnull %arrayidx, i32 0, i32 0, i32 1)
+ ret void
----------------
mshockwave wrote:
duplicate line
https://github.com/llvm/llvm-project/pull/145647
More information about the cfe-commits
mailing list