|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2025 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | + |
| 9 | +; Ensure image reads from images with read_write access qualifiers are not routed |
| 10 | +; through sampling engine. |
| 11 | + |
| 12 | +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" |
| 13 | +target triple = "spir64-unknown-unknown" |
| 14 | + |
| 15 | +%spirv.Image._void_0_0_1_0_0_0_2 = type opaque |
| 16 | +%spirv.Image._void_0_0_1_0_0_0_0 = type opaque |
| 17 | +%spirv.Image._void_0_0_1_0_0_0_1 = type opaque |
| 18 | + |
| 19 | +; RUN: igc_opt --opaque-pointers %s -S -o - -igc-conv-ocl-to-common -platformtgllp | FileCheck %s |
| 20 | + |
| 21 | +; Function Attrs: convergent nounwind |
| 22 | +define spir_kernel void @testKernel(%spirv.Image._void_0_0_1_0_0_0_2 addrspace(1)* %img, %spirv.Image._void_0_0_1_0_0_0_0 addrspace(1)* %newImg, %spirv.Image._void_0_0_1_0_0_0_1 addrspace(1)* %storeResultsImg, <8 x i32> %r0, <3 x i32> %globalOffset, <3 x i32> %enqueuedLocalSize, i16 %localIdX, i16 %localIdY, i16 %localIdZ, i8 addrspace(1)* %indirectDataPointer, i8 addrspace(1)* %scratchPointer) #0 { |
| 23 | +entry: |
| 24 | +; CHECK-NOT: typedread |
| 25 | +; CHECK: ldptr |
| 26 | + %vecinit = insertelement <2 x i32> undef, i32 1, i32 0 |
| 27 | + %vecinit3 = insertelement <2 x i32> %vecinit, i32 2, i32 1 |
| 28 | + %a0 = ptrtoint %spirv.Image._void_0_0_1_0_0_0_2 addrspace(1)* %img to i64 |
| 29 | + %a1 = call spir_func <4 x float> @__builtin_IB_OCL_1darr_ld_rw(i64 noundef %a0, <2 x i32> noundef %vecinit3, i32 noundef 0) #4 |
| 30 | + %b0 = ptrtoint %spirv.Image._void_0_0_1_0_0_0_2 addrspace(1)* %img to i64 |
| 31 | + %b1 = call spir_func <4 x i32> @__builtin_IB_OCL_1darr_ldui_rw(i64 noundef %b0, <2 x i32> noundef %vecinit3, i32 noundef 0) #4 |
| 32 | + ret void |
| 33 | +} |
| 34 | + |
| 35 | +; Function Attrs: convergent |
| 36 | +declare spir_func <4 x float> @__builtin_IB_OCL_1darr_ld_rw(i64 noundef, <2 x i32> noundef, i32 noundef) local_unnamed_addr #1 |
| 37 | + |
| 38 | +; Function Attrs: convergent |
| 39 | +declare spir_func <4 x i32> @__builtin_IB_OCL_1darr_ldui_rw(i64 noundef, <2 x i32> noundef, i32 noundef) local_unnamed_addr #1 |
| 40 | + |
| 41 | +attributes #0 = { convergent nounwind "less-precise-fpmad"="true" } |
| 42 | +attributes #1 = { convergent "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } |
| 43 | +attributes #2 = { convergent mustprogress nofree nounwind readnone willreturn "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } |
| 44 | +attributes #3 = { inaccessiblememonly nocallback nofree nosync nounwind willreturn } |
| 45 | +attributes #4 = { convergent nounwind } |
| 46 | + |
| 47 | +!spirv.MemoryModel = !{!0} |
| 48 | +!spirv.Source = !{!1} |
| 49 | +!spirv.Generator = !{!2} |
| 50 | +!igc.functions = !{!3} |
| 51 | +!IGCMetadata = !{!15} |
| 52 | +!opencl.ocl.version = !{!474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474} |
| 53 | +!opencl.spir.version = !{!474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474, !474} |
| 54 | +!llvm.ident = !{!475, !475, !475, !475, !475, !475, !475, !475, !475, !475, !475, !475, !475, !475, !475, !475} |
| 55 | +!llvm.module.flags = !{!476} |
| 56 | + |
| 57 | +!0 = !{i32 2, i32 2} |
| 58 | +!1 = !{i32 3, i32 200000} |
| 59 | +!2 = !{i16 6, i16 14} |
| 60 | +!3 = !{void (%spirv.Image._void_0_0_1_0_0_0_2 addrspace(1)*, %spirv.Image._void_0_0_1_0_0_0_0 addrspace(1)*, %spirv.Image._void_0_0_1_0_0_0_1 addrspace(1)*, <8 x i32>, <3 x i32>, <3 x i32>, i16, i16, i16, i8 addrspace(1)*, i8 addrspace(1)*)* @testKernel, !4} |
| 61 | +!4 = !{!5, !6} |
| 62 | +!5 = !{!"function_type", i32 0} |
| 63 | +!6 = !{!"implicit_arg_desc", !7, !8, !9, !10, !11, !12, !13, !14} |
| 64 | +!7 = !{i32 0} |
| 65 | +!8 = !{i32 2} |
| 66 | +!9 = !{i32 7} |
| 67 | +!10 = !{i32 8} |
| 68 | +!11 = !{i32 9} |
| 69 | +!12 = !{i32 10} |
| 70 | +!13 = !{i32 62} |
| 71 | +!14 = !{i32 63} |
| 72 | +!15 = !{!"ModuleMD", !135, !431} |
| 73 | +!135 = !{!"FuncMD", !136, !137} |
| 74 | +!136 = !{!"FuncMDMap[0]", void (%spirv.Image._void_0_0_1_0_0_0_2 addrspace(1)*, %spirv.Image._void_0_0_1_0_0_0_0 addrspace(1)*, %spirv.Image._void_0_0_1_0_0_0_1 addrspace(1)*, <8 x i32>, <3 x i32>, <3 x i32>, i16, i16, i16, i8 addrspace(1)*, i8 addrspace(1)*)* @testKernel} |
| 75 | +!137 = !{!"FuncMDValue[0]", !170, !211, !215, !219, !223, !227, !231, !235, !236} |
| 76 | +!170 = !{!"resAllocMD", !171, !172, !173, !174, !194} |
| 77 | +!171 = !{!"uavsNumType", i32 3} |
| 78 | +!172 = !{!"srvsNumType", i32 0} |
| 79 | +!173 = !{!"samplersNumType", i32 0} |
| 80 | +!174 = !{!"argAllocMDList", !175, !179, !181, !183, !187, !188, !189, !190, !191, !192, !193} |
| 81 | +!175 = !{!"argAllocMDListVec[0]", !176, !177, !178} |
| 82 | +!176 = !{!"type", i32 4} |
| 83 | +!177 = !{!"extensionType", i32 0} |
| 84 | +!178 = !{!"indexType", i32 0} |
| 85 | +!179 = !{!"argAllocMDListVec[1]", !176, !177, !180} |
| 86 | +!180 = !{!"indexType", i32 1} |
| 87 | +!181 = !{!"argAllocMDListVec[2]", !176, !177, !182} |
| 88 | +!182 = !{!"indexType", i32 2} |
| 89 | +!183 = !{!"argAllocMDListVec[3]", !184, !185, !186} |
| 90 | +!184 = !{!"type", i32 0} |
| 91 | +!185 = !{!"extensionType", i32 -1} |
| 92 | +!186 = !{!"indexType", i32 -1} |
| 93 | +!187 = !{!"argAllocMDListVec[4]", !184, !185, !186} |
| 94 | +!188 = !{!"argAllocMDListVec[5]", !184, !185, !186} |
| 95 | +!189 = !{!"argAllocMDListVec[6]", !184, !185, !186} |
| 96 | +!190 = !{!"argAllocMDListVec[7]", !184, !185, !186} |
| 97 | +!191 = !{!"argAllocMDListVec[8]", !184, !185, !186} |
| 98 | +!192 = !{!"argAllocMDListVec[9]", !184, !185, !186} |
| 99 | +!193 = !{!"argAllocMDListVec[10]", !184, !185, !186} |
| 100 | +!194 = !{!"inlineSamplersMD"} |
| 101 | +!211 = !{!"m_OpenCLArgAddressSpaces", !212, !213, !214} |
| 102 | +!212 = !{!"m_OpenCLArgAddressSpacesVec[0]", i32 1} |
| 103 | +!213 = !{!"m_OpenCLArgAddressSpacesVec[1]", i32 1} |
| 104 | +!214 = !{!"m_OpenCLArgAddressSpacesVec[2]", i32 1} |
| 105 | +!215 = !{!"m_OpenCLArgAccessQualifiers", !216, !217, !218} |
| 106 | +!216 = !{!"m_OpenCLArgAccessQualifiersVec[0]", !"read_write"} |
| 107 | +!217 = !{!"m_OpenCLArgAccessQualifiersVec[1]", !"read_only"} |
| 108 | +!218 = !{!"m_OpenCLArgAccessQualifiersVec[2]", !"write_only"} |
| 109 | +!219 = !{!"m_OpenCLArgTypes", !220, !221, !222} |
| 110 | +!220 = !{!"m_OpenCLArgTypesVec[0]", !"image1d_array_t"} |
| 111 | +!221 = !{!"m_OpenCLArgTypesVec[1]", !"image1d_array_t"} |
| 112 | +!222 = !{!"m_OpenCLArgTypesVec[2]", !"image1d_array_t"} |
| 113 | +!223 = !{!"m_OpenCLArgBaseTypes", !224, !225, !226} |
| 114 | +!224 = !{!"m_OpenCLArgBaseTypesVec[0]", !"image1d_array_t"} |
| 115 | +!225 = !{!"m_OpenCLArgBaseTypesVec[1]", !"image1d_array_t"} |
| 116 | +!226 = !{!"m_OpenCLArgBaseTypesVec[2]", !"image1d_array_t"} |
| 117 | +!227 = !{!"m_OpenCLArgTypeQualifiers", !228, !229, !230} |
| 118 | +!228 = !{!"m_OpenCLArgTypeQualifiersVec[0]", !""} |
| 119 | +!229 = !{!"m_OpenCLArgTypeQualifiersVec[1]", !""} |
| 120 | +!230 = !{!"m_OpenCLArgTypeQualifiersVec[2]", !""} |
| 121 | +!231 = !{!"m_OpenCLArgNames", !232, !233, !234} |
| 122 | +!232 = !{!"m_OpenCLArgNamesVec[0]", !"img"} |
| 123 | +!233 = !{!"m_OpenCLArgNamesVec[1]", !"newImg"} |
| 124 | +!234 = !{!"m_OpenCLArgNamesVec[2]", !"storeResultsImg"} |
| 125 | +!235 = !{!"m_OpenCLArgScalarAsPointers"} |
| 126 | +!236 = !{!"m_OptsToDisablePerFunc"} |
| 127 | +!431 = !{!"UseBindlessImage", i1 true} |
| 128 | +!474 = !{i32 2, i32 0} |
| 129 | +!475 = !{!"clang version 15.0.0"} |
| 130 | +!476 = !{i32 1, !"wchar_size", i32 4} |
0 commit comments