Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

92 lines
4.8 KiB
LLVM

; RUN: opt -passes='lower-matrix-intrinsics' -S < %s | FileCheck %s
define void @strided_store_volatile(<6 x i32> %in, ptr %out) {
; CHECK-LABEL: @strided_store_volatile(
; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <6 x i32> [[IN:%.*]], <6 x i32> poison, <3 x i32> <i32 0, i32 1, i32 2>
; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <6 x i32> [[IN]], <6 x i32> poison, <3 x i32> <i32 3, i32 4, i32 5>
; CHECK-NEXT: store volatile <3 x i32> [[SPLIT]], ptr [[OUT:%.*]], align 4
; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT]], i64 5
; CHECK-NEXT: store volatile <3 x i32> [[SPLIT1]], ptr [[VEC_GEP]], align 4
; CHECK-NEXT: ret void
;
call void @llvm.matrix.column.major.store(<6 x i32> %in, ptr %out, i64 5, i1 true, i32 3, i32 2)
ret void
}
declare void @llvm.matrix.column.major.store(<6 x i32>, ptr, i64, i1, i32, i32)
define void @multiply_store_volatile(<4 x i32> %in, ptr %out) {
; CHECK-LABEL: @multiply_store_volatile(
; CHECK: store volatile <2 x i32> {{.*}}, ptr %out, align 4
; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr inbounds i32, ptr %out, i64 2
; CHECK-NEXT: store volatile <2 x i32> {{.*}}, ptr [[VEC_GEP]], align 4
; CHECK-NEXT: ret void
;
%res = call <4 x i32> @llvm.matrix.multiply(<4 x i32> %in, <4 x i32> %in, i32 2, i32 2, i32 2)
store volatile <4 x i32> %res, ptr %out, align 4
ret void
}
declare <4 x i32> @llvm.matrix.multiply(<4 x i32>, <4 x i32>, i32, i32, i32)
define void @strided_store_align32(<6 x i32> %in, i64 %stride, ptr %out) {
; CHECK-LABEL: @strided_store_align32(
; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <6 x i32> [[IN:%.*]], <6 x i32> poison, <3 x i32> <i32 0, i32 1, i32 2>
; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <6 x i32> [[IN]], <6 x i32> poison, <3 x i32> <i32 3, i32 4, i32 5>
; CHECK-NEXT: [[VEC_START:%.*]] = mul i64 0, [[STRIDE:%.*]]
; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 [[VEC_START]]
; CHECK-NEXT: store volatile <3 x i32> [[SPLIT]], ptr [[VEC_GEP]], align 32
; CHECK-NEXT: [[VEC_START2:%.*]] = mul i64 1, [[STRIDE]]
; CHECK-NEXT: [[VEC_GEP3:%.*]] = getelementptr inbounds i32, ptr [[OUT]], i64 [[VEC_START2]]
; CHECK-NEXT: store volatile <3 x i32> [[SPLIT1]], ptr [[VEC_GEP3]], align 4
; CHECK-NEXT: ret void
;
call void @llvm.matrix.column.major.store(<6 x i32> %in, ptr align 32 %out, i64 %stride, i1 true, i32 3, i32 2)
ret void
}
define void @strided_store_align2(<6 x i32> %in, i64 %stride, ptr %out) {
; CHECK-LABEL: @strided_store_align2(
; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <6 x i32> [[IN:%.*]], <6 x i32> poison, <3 x i32> <i32 0, i32 1, i32 2>
; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <6 x i32> [[IN]], <6 x i32> poison, <3 x i32> <i32 3, i32 4, i32 5>
; CHECK-NEXT: [[VEC_START:%.*]] = mul i64 0, [[STRIDE:%.*]]
; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 [[VEC_START]]
; CHECK-NEXT: store volatile <3 x i32> [[SPLIT]], ptr [[VEC_GEP]], align 2
; CHECK-NEXT: [[VEC_START2:%.*]] = mul i64 1, [[STRIDE]]
; CHECK-NEXT: [[VEC_GEP3:%.*]] = getelementptr inbounds i32, ptr [[OUT]], i64 [[VEC_START2]]
; CHECK-NEXT: store volatile <3 x i32> [[SPLIT1]], ptr [[VEC_GEP3]], align 2
; CHECK-NEXT: ret void
;
call void @llvm.matrix.column.major.store(<6 x i32> %in, ptr align 2 %out, i64 %stride, i1 true, i32 3, i32 2)
ret void
}
define void @multiply_store_align16_stride8(<4 x i32> %in, ptr %out) {
; CHECK-LABEL: @multiply_store_align16_stride8(
; CHECK: store <2 x i32> {{.*}}, ptr %out, align 16
; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr inbounds i32, ptr %out, i64 2
; CHECK-NEXT: store <2 x i32> {{.*}}, ptr [[VEC_GEP]], align 8
; CHECK-NEXT: ret void
;
%res = call <4 x i32> @llvm.matrix.multiply(<4 x i32> %in, <4 x i32> %in, i32 2, i32 2, i32 2)
store <4 x i32> %res, ptr %out, align 16
ret void
}
define void @strided_store_align8_stride12(<6 x i32> %in, ptr %out) {
; CHECK-LABEL: @strided_store_align8_stride12(
; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <6 x i32> [[IN:%.*]], <6 x i32> poison, <2 x i32> <i32 0, i32 1>
; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <6 x i32> [[IN]], <6 x i32> poison, <2 x i32> <i32 2, i32 3>
; CHECK-NEXT: [[SPLIT2:%.*]] = shufflevector <6 x i32> [[IN]], <6 x i32> poison, <2 x i32> <i32 4, i32 5>
; CHECK-NEXT: store <2 x i32> [[SPLIT]], ptr [[OUT:%.*]], align 8
; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT]], i64 3
; CHECK-NEXT: store <2 x i32> [[SPLIT1]], ptr [[VEC_GEP]], align 4
; CHECK-NEXT: [[VEC_GEP4:%.*]] = getelementptr inbounds i32, ptr [[OUT]], i64 6
; CHECK-NEXT: store <2 x i32> [[SPLIT2]], ptr [[VEC_GEP4]], align 8
; CHECK-NEXT: ret void
;
call void @llvm.matrix.column.major.store(<6 x i32> %in, ptr align 8 %out, i64 3, i1 false, i32 2, i32 3)
ret void
}