; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s 2>%t | FileCheck %s ; RUN: llc -O0 -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s ; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t ; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it. ; WARN-NOT: warning ; ; LD1B ; define @ld1b_i8( %pred, i8* %addr) { ; CHECK-LABEL: ld1b_i8: ; CHECK: ld1b { z0.b }, p0/z, [x0] ; CHECK-NEXT: ret %res = call @llvm.aarch64.sve.ld1.nxv16i8( %pred, i8* %addr) ret %res } define @ld1b_h( %pred, i8* %addr) { ; CHECK-LABEL: ld1b_h: ; CHECK: ld1b { z0.h }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv8i8( %pred, i8* %addr) %res = zext %load to ret %res } define @ld1sb_h( %pred, i8* %addr) { ; CHECK-LABEL: ld1sb_h: ; CHECK: ld1sb { z0.h }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv8i8( %pred, i8* %addr) %res = sext %load to ret %res } define @ld1b_s( %pred, i8* %addr) { ; CHECK-LABEL: ld1b_s: ; CHECK: ld1b { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv4i8( %pred, i8* %addr) %res = zext %load to ret %res } define @ld1sb_s( %pred, i8* %addr) { ; CHECK-LABEL: ld1sb_s: ; CHECK: ld1sb { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv4i8( %pred, i8* %addr) %res = sext %load to ret %res } define @ld1b_d( %pred, i8* %addr) { ; CHECK-LABEL: ld1b_d: ; CHECK: ld1b { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv2i8( %pred, i8* %addr) %res = zext %load to ret %res } define @ld1sb_d( %pred, i8* %addr) { ; CHECK-LABEL: ld1sb_d: ; CHECK: ld1sb { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv2i8( %pred, i8* %addr) %res = sext %load to ret %res } ; ; LD1H ; define @ld1h_i16( %pred, i16* %addr) { ; CHECK-LABEL: ld1h_i16: ; CHECK: ld1h { z0.h }, p0/z, [x0] ; CHECK-NEXT: ret %res = call @llvm.aarch64.sve.ld1.nxv8i16( %pred, i16* %addr) ret %res } define @ld1h_f16( %pred, half* %addr) { ; CHECK-LABEL: ld1h_f16: ; CHECK: ld1h { z0.h }, p0/z, [x0] ; CHECK-NEXT: ret %res = call @llvm.aarch64.sve.ld1.nxv8f16( %pred, half* %addr) ret %res } define @ld1h_bf16( %pred, bfloat* %addr) #0 { ; CHECK-LABEL: ld1h_bf16: ; CHECK: ld1h { z0.h }, p0/z, [x0] ; CHECK-NEXT: ret %res = call @llvm.aarch64.sve.ld1.nxv8bf16( %pred, bfloat* %addr) ret %res } define @ld1h_s( %pred, i16* %addr) { ; CHECK-LABEL: ld1h_s: ; CHECK: ld1h { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv4i16( %pred, i16* %addr) %res = zext %load to ret %res } define @ld1sh_s( %pred, i16* %addr) { ; CHECK-LABEL: ld1sh_s: ; CHECK: ld1sh { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv4i16( %pred, i16* %addr) %res = sext %load to ret %res } define @ld1h_d( %pred, i16* %addr) { ; CHECK-LABEL: ld1h_d: ; CHECK: ld1h { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv2i16( %pred, i16* %addr) %res = zext %load to ret %res } define @ld1sh_d( %pred, i16* %addr) { ; CHECK-LABEL: ld1sh_d: ; CHECK: ld1sh { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv2i16( %pred, i16* %addr) %res = sext %load to ret %res } ; ; LD1W ; define @ld1w_i32( %pred, i32* %addr) { ; CHECK-LABEL: ld1w_i32: ; CHECK: ld1w { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %res = call @llvm.aarch64.sve.ld1.nxv4i32( %pred, i32* %addr) ret %res } define @ld1w_f32( %pred, float* %addr) { ; CHECK-LABEL: ld1w_f32: ; CHECK: ld1w { z0.s }, p0/z, [x0] ; CHECK-NEXT: ret %res = call @llvm.aarch64.sve.ld1.nxv4f32( %pred, float* %addr) ret %res } define @ld1w_d( %pred, i32* %addr) { ; CHECK-LABEL: ld1w_d: ; CHECK: ld1w { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv2i32( %pred, i32* %addr) %res = zext %load to ret %res } define @ld1sw_d( %pred, i32* %addr) { ; CHECK-LABEL: ld1sw_d: ; CHECK: ld1sw { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %load = call @llvm.aarch64.sve.ld1.nxv2i32( %pred, i32* %addr) %res = sext %load to ret %res } ; ; LD1D ; define @ld1d_i64( %pred, i64* %addr) { ; CHECK-LABEL: ld1d_i64: ; CHECK: ld1d { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %res = call @llvm.aarch64.sve.ld1.nxv2i64( %pred, i64* %addr) ret %res } define @ld1d_f64( %pred, double* %addr) { ; CHECK-LABEL: ld1d_f64: ; CHECK: ld1d { z0.d }, p0/z, [x0] ; CHECK-NEXT: ret %res = call @llvm.aarch64.sve.ld1.nxv2f64( %pred, double* %addr) ret %res } declare @llvm.aarch64.sve.ld1.nxv16i8(, i8*) declare @llvm.aarch64.sve.ld1.nxv8i8(, i8*) declare @llvm.aarch64.sve.ld1.nxv8i16(, i16*) declare @llvm.aarch64.sve.ld1.nxv8f16(, half*) declare @llvm.aarch64.sve.ld1.nxv8bf16(, bfloat*) declare @llvm.aarch64.sve.ld1.nxv4i8(, i8*) declare @llvm.aarch64.sve.ld1.nxv4i16(, i16*) declare @llvm.aarch64.sve.ld1.nxv4i32(, i32*) declare @llvm.aarch64.sve.ld1.nxv4f32(, float*) declare @llvm.aarch64.sve.ld1.nxv2i8(, i8*) declare @llvm.aarch64.sve.ld1.nxv2i16(, i16*) declare @llvm.aarch64.sve.ld1.nxv2i32(, i32*) declare @llvm.aarch64.sve.ld1.nxv2i64(, i64*) declare @llvm.aarch64.sve.ld1.nxv2f64(, double*) ; +bf16 is required for the bfloat version. attributes #0 = { "target-features"="+sve,+bf16" }