; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes='lower-matrix-intrinsics' -S < %s | FileCheck %s
define void @strided_store_3x2(<6 x double> %in, ptr %out) {
; CHECK-LABEL: @strided_store_3x2(
; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <6 x double> [[IN:%.*]], <6 x double> poison, <3 x i32> <i32 0, i32 1, i32 2>
; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <6 x double> [[IN]], <6 x double> poison, <3 x i32> <i32 3, i32 4, i32 5>
; CHECK-NEXT: store <3 x double> [[SPLIT]], ptr [[OUT:%.*]], align 8
; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr double, ptr [[OUT]], i64 5
; CHECK-NEXT: store <3 x double> [[SPLIT1]], ptr [[VEC_GEP]], align 8
; CHECK-NEXT: ret void
;
call void @llvm.matrix.column.major.store.v6f64.i64(<6 x double> %in, ptr %out, i64 5, i1 false, i32 3, i32 2)
ret void
}
define void @strided_store_3x2_nonconst_stride(<6 x double> %in, i64 %stride, ptr %out) {
; CHECK-LABEL: @strided_store_3x2_nonconst_stride(
; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <6 x double> [[IN:%.*]], <6 x double> poison, <3 x i32> <i32 0, i32 1, i32 2>
; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <6 x double> [[IN]], <6 x double> poison, <3 x i32> <i32 3, i32 4, i32 5>
; CHECK-NEXT: [[VEC_START:%.*]] = mul i64 0, [[STRIDE:%.*]]
; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr double, ptr [[OUT:%.*]], i64 [[VEC_START]]
; CHECK-NEXT: store <3 x double> [[SPLIT]], ptr [[VEC_GEP]], align 8
; CHECK-NEXT: [[VEC_START2:%.*]] = mul i64 1, [[STRIDE]]
; CHECK-NEXT: [[VEC_GEP3:%.*]] = getelementptr double, ptr [[OUT]], i64 [[VEC_START2]]
; CHECK-NEXT: store <3 x double> [[SPLIT1]], ptr [[VEC_GEP3]], align 8
; CHECK-NEXT: ret void
;
call void @llvm.matrix.column.major.store.v6f64.i64(<6 x double> %in, ptr %out, i64 %stride, i1 false, i32 3, i32 2)
ret void
}
define void @strided_store_3x2_nonconst_i32_stride(<6 x double> %in, i32 %stride, ptr %out) {
; CHECK-LABEL: @strided_store_3x2_nonconst_i32_stride(
; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <6 x double> [[IN:%.*]], <6 x double> poison, <3 x i32> <i32 0, i32 1, i32 2>
; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <6 x double> [[IN]], <6 x double> poison, <3 x i32> <i32 3, i32 4, i32 5>
; CHECK-NEXT: [[VEC_START:%.*]] = mul i32 0, [[STRIDE:%.*]]
; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr double, ptr [[OUT:%.*]], i32 [[VEC_START]]
; CHECK-NEXT: store <3 x double> [[SPLIT]], ptr [[VEC_GEP]], align 8
; CHECK-NEXT: [[VEC_START2:%.*]] = mul i32 1, [[STRIDE]]
; CHECK-NEXT: [[VEC_GEP3:%.*]] = getelementptr double, ptr [[OUT]], i32 [[VEC_START2]]
; CHECK-NEXT: store <3 x double> [[SPLIT1]], ptr [[VEC_GEP3]], align 8
; CHECK-NEXT: ret void
;
call void @llvm.matrix.column.major.store.v6f64.i32(<6 x double> %in, ptr %out, i32 %stride, i1 false, i32 3, i32 2)
ret void
}
define void @strided_store_2x3(<10 x double> %in, ptr %out) {
; CHECK-LABEL: @strided_store_2x3(
; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <10 x double> [[IN:%.*]], <10 x double> poison, <2 x i32> <i32 0, i32 1>
; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <10 x double> [[IN]], <10 x double> poison, <2 x i32> <i32 2, i32 3>
; CHECK-NEXT: [[SPLIT2:%.*]] = shufflevector <10 x double> [[IN]], <10 x double> poison, <2 x i32> <i32 4, i32 5>
; CHECK-NEXT: [[SPLIT3:%.*]] = shufflevector <10 x double> [[IN]], <10 x double> poison, <2 x i32> <i32 6, i32 7>
; CHECK-NEXT: [[SPLIT4:%.*]] = shufflevector <10 x double> [[IN]], <10 x double> poison, <2 x i32> <i32 8, i32 9>
; CHECK-NEXT: store <2 x double> [[SPLIT]], ptr [[OUT:%.*]], align 8
; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr double, ptr [[OUT]], i64 4
; CHECK-NEXT: store <2 x double> [[SPLIT1]], ptr [[VEC_GEP]], align 8
; CHECK-NEXT: [[VEC_GEP5:%.*]] = getelementptr double, ptr [[OUT]], i64 8
; CHECK-NEXT: store <2 x double> [[SPLIT2]], ptr [[VEC_GEP5]], align 8
; CHECK-NEXT: [[VEC_GEP6:%.*]] = getelementptr double, ptr [[OUT]], i64 12
; CHECK-NEXT: store <2 x double> [[SPLIT3]], ptr [[VEC_GEP6]], align 8
; CHECK-NEXT: [[VEC_GEP7:%.*]] = getelementptr double, ptr [[OUT]], i64 16
; CHECK-NEXT: store <2 x double> [[SPLIT4]], ptr [[VEC_GEP7]], align 8
; CHECK-NEXT: ret void
;
call void @llvm.matrix.column.major.store.v10f64.i64(<10 x double> %in, ptr %out, i64 4, i1 false, i32 2, i32 5)
ret void
}
declare void @llvm.matrix.column.major.store.v6f64.i64(<6 x double>, ptr, i64, i1, i32, i32)
declare void @llvm.matrix.column.major.store.v6f64.i32(<6 x double>, ptr, i32, i1, i32, i32)
declare void @llvm.matrix.column.major.store.v10f64.i64(<10 x double>, ptr, i64, i1, i32, i32)
; CHECK: declare void @llvm.matrix.column.major.store.v6f64.i64(<6 x double>, ptr nocapture writeonly, i64, i1 immarg, i32 immarg, i32 immarg) #0
; CHECK: declare void @llvm.matrix.column.major.store.v10f64.i64(<10 x double>, ptr nocapture writeonly, i64, i1 immarg, i32 immarg, i32 immarg) #0
; CHECK: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: write) }