Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/DirectX/matrix-transpose.ll
T
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

66 lines
3.0 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s
; Verify that llvm.matrix.transpose is expanded to shufflevector for DXIL.
declare <6 x float> @llvm.matrix.transpose.v6f32(<6 x float>, i32, i32)
declare <12 x i32> @llvm.matrix.transpose.v12i32(<12 x i32>, i32, i32)
declare <16 x float> @llvm.matrix.transpose.v16f32(<16 x float>, i32, i32)
declare <4 x float> @llvm.matrix.transpose.v4f32(<4 x float>, i32, i32)
declare <4 x half> @llvm.matrix.transpose.v4f16(<4 x half>, i32, i32)
; 2x3 float -> 3x2 float
define <6 x float> @test_transpose_float2x3(<6 x float> %m) {
; CHECK-LABEL: define <6 x float> @test_transpose_float2x3(
; CHECK-SAME: <6 x float> [[M:%.*]]) {
; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <6 x float> [[M]], <6 x float> poison, <6 x i32> <i32 0, i32 2, i32 4, i32 1, i32 3, i32 5>
; CHECK-NEXT: ret <6 x float> [[TMP12]]
;
%r = call <6 x float> @llvm.matrix.transpose.v6f32(<6 x float> %m, i32 2, i32 3)
ret <6 x float> %r
}
; 4x3 int -> 3x4 int
define <12 x i32> @test_transpose_int4x3(<12 x i32> %m) {
; CHECK-LABEL: define <12 x i32> @test_transpose_int4x3(
; CHECK-SAME: <12 x i32> [[M:%.*]]) {
; CHECK-NEXT: [[TMP24:%.*]] = shufflevector <12 x i32> [[M]], <12 x i32> poison, <12 x i32> <i32 0, i32 4, i32 8, i32 1, i32 5, i32 9, i32 2, i32 6, i32 10, i32 3, i32 7, i32 11>
; CHECK-NEXT: ret <12 x i32> [[TMP24]]
;
%r = call <12 x i32> @llvm.matrix.transpose.v12i32(<12 x i32> %m, i32 4, i32 3)
ret <12 x i32> %r
}
; 4x4 float -> 4x4 float
define <16 x float> @test_transpose_float4x4(<16 x float> %m) {
; CHECK-LABEL: define <16 x float> @test_transpose_float4x4(
; CHECK-SAME: <16 x float> [[M:%.*]]) {
; CHECK-NEXT: [[TMP32:%.*]] = shufflevector <16 x float> [[M]], <16 x float> poison, <16 x i32> <i32 0, i32 4, i32 8, i32 12, i32 1, i32 5, i32 9, i32 13, i32 2, i32 6, i32 10, i32 14, i32 3, i32 7, i32 11, i32 15>
; CHECK-NEXT: ret <16 x float> [[TMP32]]
;
%r = call <16 x float> @llvm.matrix.transpose.v16f32(<16 x float> %m, i32 4, i32 4)
ret <16 x float> %r
}
; 1x4 float -> 4x1 float
define <4 x float> @test_transpose_float1x4(<4 x float> %m) {
; CHECK-LABEL: define <4 x float> @test_transpose_float1x4(
; CHECK-SAME: <4 x float> [[M:%.*]]) {
; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <4 x float> [[M]], <4 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
; CHECK-NEXT: ret <4 x float> [[TMP8]]
;
%r = call <4 x float> @llvm.matrix.transpose.v4f32(<4 x float> %m, i32 1, i32 4)
ret <4 x float> %r
}
; 2x2 half -> 2x2 half
define <4 x half> @test_transpose_half2x2(<4 x half> %m) {
; CHECK-LABEL: define <4 x half> @test_transpose_half2x2(
; CHECK-SAME: <4 x half> [[M:%.*]]) {
; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <4 x half> [[M]], <4 x half> poison, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
; CHECK-NEXT: ret <4 x half> [[TMP8]]
;
%r = call <4 x half> @llvm.matrix.transpose.v4f16(<4 x half> %m, i32 2, i32 2)
ret <4 x half> %r
}