|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2024 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | +; |
| 9 | +; RUN: igc_opt -platformpvc -igc-joint-matrix-resolution -S 2>&1 < %s | FileCheck %s |
| 10 | +; ------------------------------------------------ |
| 11 | +; JointMatrixFuncsResolutionPass |
| 12 | +; ------------------------------------------------ |
| 13 | + |
| 14 | +%spirv.JointMatrixINTEL._float_8_16_3_3_2 = type opaque |
| 15 | +%spirv.JointMatrixINTEL._short_8_16_0_3_0 = type opaque |
| 16 | +%spirv.JointMatrixINTEL._short_16_16_2_3_1 = type opaque |
| 17 | + |
| 18 | +; CHECK-LABEL: define spir_kernel void @test( |
| 19 | +; CHECK-SAME: i8 addrspace(1)* [[PTR1:%.*]], i8 addrspace(1)* [[PTR2:%.*]], float addrspace(1)* [[PTR3:%.*]]) { |
| 20 | +define spir_kernel void @test(i8 addrspace(1)* %ptr1, i8 addrspace(1)* %ptr2, float addrspace(1)* %ptr3) { |
| 21 | +; CHECK: [[TMP1:%.*]] = alloca <8 x float> |
| 22 | +; CHECK: [[TMP2:%.*]] = alloca <8 x i32> |
| 23 | +; CHECK: [[TMP3:%.*]] = alloca <8 x i16> |
| 24 | +; CHECK: [[TMP4:%.*]] = alloca <8 x float> |
| 25 | +; CHECK: [[TMP5:%.*]] = bitcast <8 x float>* [[TMP4]] to i8* |
| 26 | +; CHECK: call void @__builtin_spriv_OpJointMatrixFillCheckedINTEL_i32_8(i8* [[TMP5]], i32 3, i32 4, i32 5, i32 6, i32 1065353216) |
| 27 | +; CHECK: [[TMP6:%.*]] = load <8 x float>, <8 x float>* [[TMP4]] |
| 28 | +; CHECK: [[TMP7:%.*]] = bitcast <8 x i16>* [[TMP3]] to i8* |
| 29 | +; CHECK: call void @__builtin_spriv_OpJointMatrixLoadCheckedINTEL_PackedA_RowMajor_SG16_8x16_i16_8_v8i8_pi32_i32(i8* [[TMP7]], i8 addrspace(1)* %ptr1, i32 3, i32 4, i32 10, i32 11, i64 12, i32 0) |
| 30 | +; CHECK: load <8 x i16>, <8 x i16>* [[TMP3]] |
| 31 | +; CHECK: [[TMP9:%.*]] = bitcast <8 x i32>* [[TMP2]] to i8* |
| 32 | +; CHECK: call void @__builtin_spriv_OpJointMatrixLoadCheckedINTEL_PackedB_PackedB_SG16_16x16_i16_8_v8i8_pi32_i32(i8* [[TMP9]], i8 addrspace(1)* %ptr2, i32 2, i32 3, i32 13, i32 14, i64 14, i32 0) |
| 33 | +; CHECK: [[TMP10:%.*]] = load <8 x i32>, <8 x i32>* [[TMP2]] |
| 34 | +; CHECK: store <8 x float> [[TMP6]], <8 x float>* [[TMP1]] |
| 35 | +; CHECK: [[TMP11:%.*]] = bitcast <8 x float>* [[TMP1]] to i8* |
| 36 | +; CHECK: call void @__builtin_spriv_OpJointMatrixStoreCheckedINTEL_Accumulator_RowMajor_SG16_8x16_i32_8_pi64_v8i8(float addrspace(1)* %ptr3, i8* [[TMP11]], i32 5, i32 6, i32 12, i32 13, i64 13, i32 0) |
| 37 | +; CHECK: ret void |
| 38 | + %1 = call spir_func %spirv.JointMatrixINTEL._float_8_16_3_3_2 addrspace(1)* @_Z46__spirv_CooperativeMatrixConstructCheckedINTELiiiif(i32 3, i32 4, i32 5, i32 6, float 1.000000e+00) #0 |
| 39 | + %2 = call spir_func %spirv.JointMatrixINTEL._short_8_16_0_3_0 addrspace(1)* @_Z93__spirv_CooperativeMatrixLoadCheckedINTEL_RPU3AS142__spirv_JointMatrixINTEL__short_8_16_0_3_0PU3AS1ciiiiili(i8 addrspace(1)* %ptr1, i32 3, i32 4, i32 0, i32 10, i32 11, i64 12, i32 0) #0 |
| 40 | + %3 = call spir_func %spirv.JointMatrixINTEL._short_16_16_2_3_1 addrspace(1)* @_Z94__spirv_CooperativeMatrixLoadCheckedINTEL_RPU3AS143__spirv_JointMatrixINTEL__short_16_16_2_3_1PU3AS1ciiiiili(i8 addrspace(1)* %ptr2, i32 2, i32 3, i32 2, i32 13, i32 14, i64 14, i32 0) #0 |
| 41 | + call spir_func void @_Z42__spirv_CooperativeMatrixStoreCheckedINTELPU3AS1fiiPU3AS142__spirv_JointMatrixINTEL__float_8_16_3_3_2iiili(float addrspace(1)* %ptr3, i32 5, i32 6, %spirv.JointMatrixINTEL._float_8_16_3_3_2 addrspace(1)* %1, i32 0, i32 12, i32 13, i64 13, i32 0) #0 |
| 42 | + |
| 43 | + ret void |
| 44 | +} |
| 45 | + |
| 46 | +declare spir_func %spirv.JointMatrixINTEL._float_8_16_3_3_2 addrspace(1)* @_Z46__spirv_CooperativeMatrixConstructCheckedINTELiiiif(i32, i32, i32, i32, float) #0 |
| 47 | +declare spir_func %spirv.JointMatrixINTEL._short_8_16_0_3_0 addrspace(1)* @_Z93__spirv_CooperativeMatrixLoadCheckedINTEL_RPU3AS142__spirv_JointMatrixINTEL__short_8_16_0_3_0PU3AS1ciiiiili(i8 addrspace(1)*, i32, i32, i32, i32, i32, i64, i32) #0 |
| 48 | +declare spir_func %spirv.JointMatrixINTEL._short_16_16_2_3_1 addrspace(1)* @_Z94__spirv_CooperativeMatrixLoadCheckedINTEL_RPU3AS143__spirv_JointMatrixINTEL__short_16_16_2_3_1PU3AS1ciiiiili(i8 addrspace(1)*, i32, i32, i32, i32, i32, i64, i32) #0 |
| 49 | +declare spir_func void @_Z42__spirv_CooperativeMatrixStoreCheckedINTELPU3AS1fiiPU3AS142__spirv_JointMatrixINTEL__float_8_16_3_3_2iiili(float addrspace(1)*, i32, i32, %spirv.JointMatrixINTEL._float_8_16_3_3_2 addrspace(1)*, i32, i32, i32, i64, i32) #0 |
| 50 | + |
| 51 | +!igc.functions = !{!0} |
| 52 | +!0 = !{void (i8 addrspace(1)*, i8 addrspace(1)*, float addrspace(1)*)* @test, !1} |
| 53 | +!1 = !{!2, !3} |
| 54 | +!2 = !{!"function_type", i32 0} |
| 55 | +!3 = !{!"sub_group_size", i32 16} |
0 commit comments