103 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc -mtriple=riscv32 -mattr=+xmipscbop -verify-machineinstrs < %s \3; RUN: | FileCheck %s -check-prefix=RV32XMIPSPREFETCH4; RUN: llc -mtriple=riscv64 -mattr=+xmipscbop -verify-machineinstrs < %s \5; RUN: | FileCheck %s -check-prefix=RV64XMIPSPREFETCH6 7define void @prefetch_data_read(ptr noundef %ptr) nounwind {8; RV32XMIPSPREFETCH-LABEL: prefetch_data_read:9; RV32XMIPSPREFETCH: # %bb.0: # %entry10; RV32XMIPSPREFETCH-NEXT: mips.pref 8, 1(a0)11; RV32XMIPSPREFETCH-NEXT: ret12;13; RV64XMIPSPREFETCH-LABEL: prefetch_data_read:14; RV64XMIPSPREFETCH: # %bb.0: # %entry15; RV64XMIPSPREFETCH-NEXT: mips.pref 8, 1(a0)16; RV64XMIPSPREFETCH-NEXT: ret17entry:18 %arrayidx = getelementptr inbounds nuw i8, ptr %ptr, i64 119 tail call void @llvm.prefetch.p0(ptr nonnull %arrayidx, i32 0, i32 0, i32 1)20 ret void21}22 23define void @prefetch_data_write(ptr noundef %ptr) nounwind {24; RV32XMIPSPREFETCH-LABEL: prefetch_data_write:25; RV32XMIPSPREFETCH: # %bb.0:26; RV32XMIPSPREFETCH-NEXT: addi a0, a0, 51227; RV32XMIPSPREFETCH-NEXT: mips.pref 9, 0(a0)28; RV32XMIPSPREFETCH-NEXT: ret29;30; RV64XMIPSPREFETCH-LABEL: prefetch_data_write:31; RV64XMIPSPREFETCH: # %bb.0:32; RV64XMIPSPREFETCH-NEXT: addi a0, a0, 51233; RV64XMIPSPREFETCH-NEXT: mips.pref 9, 0(a0)34; RV64XMIPSPREFETCH-NEXT: ret35 %arrayidx = getelementptr inbounds nuw i8, ptr %ptr, i64 51236 tail call void @llvm.prefetch.p0(ptr nonnull %arrayidx, i32 1, i32 0, i32 1)37 ret void38}39 40define void @prefetch_inst_read(ptr noundef %ptr) nounwind {41; RV32XMIPSPREFETCH-LABEL: prefetch_inst_read:42; RV32XMIPSPREFETCH: # %bb.0:43; RV32XMIPSPREFETCH-NEXT: ret44;45; RV64XMIPSPREFETCH-LABEL: prefetch_inst_read:46; RV64XMIPSPREFETCH: # %bb.0:47; RV64XMIPSPREFETCH-NEXT: ret48 %arrayidx = getelementptr inbounds nuw i8, ptr %ptr, i64 51249 tail call void @llvm.prefetch.p0(ptr nonnull %arrayidx, i32 0, i32 0, i32 0)50 ret void51}52 53define void @prefetch_frameindex_test_neg() nounwind {54; RV32XMIPSPREFETCH-LABEL: prefetch_frameindex_test_neg:55; RV32XMIPSPREFETCH: # %bb.0:56; RV32XMIPSPREFETCH-NEXT: lui a0, 157; RV32XMIPSPREFETCH-NEXT: addi a0, a0, 1658; RV32XMIPSPREFETCH-NEXT: sub sp, sp, a059; RV32XMIPSPREFETCH-NEXT: addi a0, sp, 52460; RV32XMIPSPREFETCH-NEXT: mips.pref 8, 0(a0)61; RV32XMIPSPREFETCH-NEXT: lui a0, 162; RV32XMIPSPREFETCH-NEXT: addi a0, a0, 1663; RV32XMIPSPREFETCH-NEXT: add sp, sp, a064; RV32XMIPSPREFETCH-NEXT: ret65;66; RV64XMIPSPREFETCH-LABEL: prefetch_frameindex_test_neg:67; RV64XMIPSPREFETCH: # %bb.0:68; RV64XMIPSPREFETCH-NEXT: lui a0, 169; RV64XMIPSPREFETCH-NEXT: addi a0, a0, 1670; RV64XMIPSPREFETCH-NEXT: sub sp, sp, a071; RV64XMIPSPREFETCH-NEXT: addi a0, sp, 52472; RV64XMIPSPREFETCH-NEXT: mips.pref 8, 0(a0)73; RV64XMIPSPREFETCH-NEXT: lui a0, 174; RV64XMIPSPREFETCH-NEXT: addi a0, a0, 1675; RV64XMIPSPREFETCH-NEXT: add sp, sp, a076; RV64XMIPSPREFETCH-NEXT: ret77 %data = alloca [1024 x i32], align 478 %ptr = getelementptr [1024 x i32], ptr %data, i32 0, i32 12779 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)80 ret void81}82 83define void @prefetch_frameindex_test() nounwind {84; RV32XMIPSPREFETCH-LABEL: prefetch_frameindex_test:85; RV32XMIPSPREFETCH: # %bb.0:86; RV32XMIPSPREFETCH-NEXT: addi sp, sp, -51287; RV32XMIPSPREFETCH-NEXT: mips.pref 8, 32(sp)88; RV32XMIPSPREFETCH-NEXT: addi sp, sp, 51289; RV32XMIPSPREFETCH-NEXT: ret90;91; RV64XMIPSPREFETCH-LABEL: prefetch_frameindex_test:92; RV64XMIPSPREFETCH: # %bb.0:93; RV64XMIPSPREFETCH-NEXT: addi sp, sp, -51294; RV64XMIPSPREFETCH-NEXT: mips.pref 8, 32(sp)95; RV64XMIPSPREFETCH-NEXT: addi sp, sp, 51296; RV64XMIPSPREFETCH-NEXT: ret97 %data = alloca [128 x i32], align 498 %base = bitcast ptr %data to ptr99 %ptr = getelementptr [128 x i32], ptr %base, i32 0, i32 8100 call void @llvm.prefetch(ptr %ptr, i32 0, i32 0, i32 1)101 ret void102}103