|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2025 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | +; This test runs vISA EmitPass and checks if 2d block read needs zero padding. |
| 9 | +; It checks warning messages |
| 10 | + |
| 11 | +; REQUIRES: llvm-14-plus, regkeys |
| 12 | + |
| 13 | +; RUN: igc_opt --opaque-pointers -platformpvc -igc-emit-visa %s -regkey EnableDebugging \ |
| 14 | +; RUN: -simd-mode 16 | FileCheck %s |
| 15 | + |
| 16 | +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32" |
| 17 | +target triple = "spir64-unknown-unknown" |
| 18 | + |
| 19 | +; |
| 20 | +; Function Attrs: convergent nounwind null_pointer_is_valid |
| 21 | +define spir_kernel void @test_2dblock_read_zero_padding(i16 addrspace(1)* align 2 %dst, i64 %base, i32 %widthm1, i32 %heightm1, i32 %pitchm1, i32 %x, i32 %y, <8 x i32> %r0, <8 x i32> %payloadHeader, <3 x i32> %enqueuedLocalSize, i16 %localIdX, i16 %localIdY, i16 %localIdZ, i32 %bufferOffset) #1 { |
| 22 | +entry: |
| 23 | +%ibase = ptrtoint i16 addrspace(1)* %dst to i64 |
| 24 | + %lid = zext i16 %localIdX to i64 |
| 25 | + %tmp = add i64 %ibase, %lid |
| 26 | +; |
| 27 | +; case 0 u32_m1k8v2 |
| 28 | +; CHECK: warning: Block2D: block size not multiple of GRF size, zero padded |
| 29 | +; |
| 30 | + %res0 = call <2 x i32> @llvm.genx.GenISA.LSC2DBlockRead.v2i32(i64 %base, i32 %widthm1, i32 %heightm1, i32 %pitchm1, i32 %x, i32 %y, i32 32, i32 8, i32 1, i32 2, i1 false, i1 false, i32 0) |
| 31 | + %tmp0 = add i64 %tmp, 16 |
| 32 | + %addr0 = inttoptr i64 %tmp0 to <2 x i32> addrspace(1)* |
| 33 | + store <2 x i32> %res0, <2 x i32> addrspace(1)* %addr0, align 8 |
| 34 | + |
| 35 | +; |
| 36 | +; case 1 u32_m7k2 transpose |
| 37 | +; CHECK: warning: Block2D: transpose block height not power of 2, zero padded |
| 38 | +; |
| 39 | + %res1 = call i32 @llvm.genx.GenISA.LSC2DBlockRead.i32(i64 %base, i32 %widthm1, i32 %heightm1, i32 %pitchm1, i32 %x, i32 %y, i32 32, i32 2, i32 7, i32 1, i1 true, i1 false, i32 0) |
| 40 | + %tmp1 = add i64 %tmp, 128 |
| 41 | + %addr1 = inttoptr i64 %tmp1 to i32 addrspace(1)* |
| 42 | + store i32 %res1, i32 addrspace(1)* %addr1, align 8 |
| 43 | + |
| 44 | +; |
| 45 | +; case 2 u8_m29k2 vnni transform |
| 46 | +; CHECK: warning: Block2D: transform block height not multiple of N (32/eltBits), zero padded. |
| 47 | +; |
| 48 | + %res2 = call <2 x i16> @llvm.genx.GenISA.LSC2DBlockRead.v2i16(i64 %base, i32 %widthm1, i32 %heightm1, i32 %pitchm1, i32 %x, i32 %y, i32 8, i32 2, i32 29, i32 1, i1 false, i1 true, i32 0) |
| 49 | + %tmp2 = add i64 %tmp, 512 |
| 50 | + %res20 = bitcast <2 x i16> %res2 to i32 |
| 51 | + %addr2 = inttoptr i64 %tmp2 to i32 addrspace(1)* |
| 52 | + store i32 %res20, i32 addrspace(1)* %addr2, align 8 |
| 53 | + |
| 54 | + ret void |
| 55 | +} |
| 56 | + |
| 57 | +declare <2 x i16> @llvm.genx.GenISA.LSC2DBlockRead.v2i16(i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i1, i1, i32) |
| 58 | +declare <2 x i32> @llvm.genx.GenISA.LSC2DBlockRead.v2i32(i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i1, i1, i32) |
| 59 | +declare i32 @llvm.genx.GenISA.LSC2DBlockRead.i32(i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i1, i1, i32) |
| 60 | + |
| 61 | +!igc.functions = !{!3} |
| 62 | +!IGCMetadata = !{!16} |
| 63 | + |
| 64 | +!3 = !{void (i16 addrspace(1)*, i64, i32, i32, i32, i32, i32, <8 x i32>, <8 x i32>, <3 x i32>, i16, i16, i16, i32)* @test_2dblock_read_zero_padding, !4} |
| 65 | +!4 = !{!5, !6, !15} |
| 66 | +!5 = !{!"function_type", i32 0} |
| 67 | +!6 = !{!"implicit_arg_desc", !7, !8, !9, !10, !11, !12, !13} |
| 68 | +!7 = !{i32 0} |
| 69 | +!8 = !{i32 1} |
| 70 | +!9 = !{i32 7} |
| 71 | +!10 = !{i32 8} |
| 72 | +!11 = !{i32 9} |
| 73 | +!12 = !{i32 10} |
| 74 | +!13 = !{i32 15, !14} |
| 75 | +!14 = !{!"explicit_arg_num", i32 0} |
| 76 | +!15 = !{!"sub_group_size", i32 16} |
| 77 | +!16 = !{!"ModuleMD", !131} |
| 78 | +!131 = !{!"FuncMD", !132, !133} |
| 79 | +!132 = !{!"FuncMDMap[0]", void (i16 addrspace(1)*, i64, i32, i32, i32, i32, i32, <8 x i32>, <8 x i32>, <3 x i32>, i16, i16, i16, i32)* @test_2dblock_read_zero_padding} |
| 80 | +!133 = !{!"FuncMDValue[0]", !166, !237} |
| 81 | +!166 = !{!"resAllocMD", !170} |
| 82 | +!170 = !{!"argAllocMDList", !171, !175, !176, !177, !178, !179, !180, !181, !182, !183, !184, !185, !186, !187} |
| 83 | +!171 = !{!"argAllocMDListVec[0]", !172, !173, !174} |
| 84 | +!172 = !{!"type", i32 0} |
| 85 | +!173 = !{!"extensionType", i32 -1} |
| 86 | +!174 = !{!"indexType", i32 -1} |
| 87 | +!175 = !{!"argAllocMDListVec[1]", !172, !173, !174} |
| 88 | +!176 = !{!"argAllocMDListVec[2]", !172, !173, !174} |
| 89 | +!177 = !{!"argAllocMDListVec[3]", !172, !173, !174} |
| 90 | +!178 = !{!"argAllocMDListVec[4]", !172, !173, !174} |
| 91 | +!179 = !{!"argAllocMDListVec[5]", !172, !173, !174} |
| 92 | +!180 = !{!"argAllocMDListVec[6]", !172, !173, !174} |
| 93 | +!181 = !{!"argAllocMDListVec[7]", !172, !173, !174} |
| 94 | +!182 = !{!"argAllocMDListVec[8]", !172, !173, !174} |
| 95 | +!183 = !{!"argAllocMDListVec[9]", !172, !173, !174} |
| 96 | +!184 = !{!"argAllocMDListVec[10]", !172, !173, !174} |
| 97 | +!185 = !{!"argAllocMDListVec[11]", !172, !173, !174} |
| 98 | +!186 = !{!"argAllocMDListVec[12]", !172, !173, !174} |
| 99 | +!187 = !{!"argAllocMDListVec[13]", !172, !173, !174} |
| 100 | +!237 = !{!"m_OpenCLArgTypeQualifiers", !238, !239, !240, !241, !242, !243, !244} |
| 101 | +!238 = !{!"m_OpenCLArgTypeQualifiersVec[0]", !""} |
| 102 | +!239 = !{!"m_OpenCLArgTypeQualifiersVec[1]", !""} |
| 103 | +!240 = !{!"m_OpenCLArgTypeQualifiersVec[2]", !""} |
| 104 | +!241 = !{!"m_OpenCLArgTypeQualifiersVec[3]", !""} |
| 105 | +!242 = !{!"m_OpenCLArgTypeQualifiersVec[4]", !""} |
| 106 | +!243 = !{!"m_OpenCLArgTypeQualifiersVec[5]", !""} |
| 107 | +!244 = !{!"m_OpenCLArgTypeQualifiersVec[6]", !""} |
0 commit comments