|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2025 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | +; REQUIRES: regkeys, llvm-14-plus |
| 9 | + |
| 10 | +; RUN: igc_opt -ocl -platformdg2 -igc-emit-visa -regkey DumpVISAASMToConsole < %s | FileCheck %s |
| 11 | +; ------------------------------------------------ |
| 12 | +; EmitVISAPass |
| 13 | +; ------------------------------------------------ |
| 14 | + |
| 15 | +; Test checks if volatile load/store instructions emit uncached LSC intructions |
| 16 | + |
| 17 | +define spir_kernel void @test(i32 addrspace(1)* %dst, i32 %bindlessOffset) { |
| 18 | +entry: |
| 19 | + ; CHECK: lsc_load.ugm.uc.uc {{.*}} |
| 20 | + ; CHECK: lsc_store.ugm.uc.uc {{.*}} |
| 21 | + %0 = load volatile i32, i32 addrspace(1)* %dst |
| 22 | + store volatile i32 %0, i32 addrspace(1)* %dst |
| 23 | + |
| 24 | + ; CHECK: lsc_load.ugm.uc.uc {{.*}} |
| 25 | + ; CHECK: lsc_store.ugm.uc.uc {{.*}} |
| 26 | + %1 = inttoptr i32 %bindlessOffset to float addrspace(2490368)* |
| 27 | + %2 = call float @llvm.genx.GenISA.ldraw.indexed.f32.p2490368f32(float addrspace(2490368)* %1, i32 %0, i32 4, i1 true) |
| 28 | + call void @llvm.genx.GenISA.storeraw.indexed.p2490368f32.f32(float addrspace(2490368)* %1, i32 4, float %2, i32 4, i1 true) |
| 29 | + |
| 30 | + ; COM: Checks below can be enabled when PredicatedLoad and PredicatedStore class will |
| 31 | + ; COM: start supporting volatile instructions. |
| 32 | + ; COM: lsc_load.ugm.uc.uc {{.*}} |
| 33 | + ; COM: lsc_store.ugm.uc.uc {{.*}} |
| 34 | + ; COM: %3 = call i32 @llvm.genx.GenISA.PredicatedLoad.i32.p1i32.i32(i32 addrspace(1)* %dst, i64 4, i1 true, i32 4) |
| 35 | + ; COM: call void @llvm.genx.GenISA.PredicatedStore.p1i32.i32(i32 addrspace(1)* %dst, i32 1, i64 2, i1 true) |
| 36 | + ret void |
| 37 | +} |
| 38 | + |
| 39 | +declare float @llvm.genx.GenISA.ldraw.indexed.f32.p2490368f32(float addrspace(2490368)*, i32, i32, i1) #0 |
| 40 | +declare void @llvm.genx.GenISA.storeraw.indexed.p2490368f32.f32(float addrspace(2490368)*, i32, float, i32, i1) #1 |
| 41 | +; declare i32 @llvm.genx.GenISA.PredicatedLoad.i32.p1i32.i32(i32 addrspace(1)*, i64, i1, i32) |
| 42 | +; declare void @llvm.genx.GenISA.PredicatedStore.p1i32.i32(i32 addrspace(1)*, i32, i64, i1) |
| 43 | + |
| 44 | +attributes #0 = { argmemonly nounwind readonly willreturn } |
| 45 | +attributes #1 = { argmemonly nounwind writeonly } |
| 46 | + |
| 47 | +!IGCMetadata = !{!0} |
| 48 | +!igc.functions = !{!21} |
| 49 | + |
| 50 | +!0 = !{!"ModuleMD", !1} |
| 51 | +!1 = !{!"FuncMD", !2, !3} |
| 52 | +!2 = !{!"FuncMDMap[0]", void (i32 addrspace(1)*, i32)* @test} |
| 53 | +!3 = !{!"FuncMDValue[0]", !4, !17} |
| 54 | +!4 = !{!"resAllocMD", !5} |
| 55 | +!5 = !{!"argAllocMDList", !6, !10, !11, !14, !15, !16} |
| 56 | +!6 = !{!"argAllocMDListVec[0]", !7, !8, !9} |
| 57 | +!7 = !{!"type", i32 0} |
| 58 | +!8 = !{!"extensionType", i32 -1} |
| 59 | +!9 = !{!"indexType", i32 -1} |
| 60 | +!10 = !{!"argAllocMDListVec[1]", !7, !8, !9} |
| 61 | +!11 = !{!"argAllocMDListVec[2]", !12, !8, !13} |
| 62 | +!12 = !{!"type", i32 1} |
| 63 | +!13 = !{!"indexType", i32 0} |
| 64 | +!14 = !{!"argAllocMDListVec[3]", !7, !8, !9} |
| 65 | +!15 = !{!"argAllocMDListVec[4]", !7, !8, !9} |
| 66 | +!16 = !{!"argAllocMDListVec[5]", !7, !8, !9} |
| 67 | +!17 = !{!"m_OpenCLArgTypeQualifiers", !18, !19, !20} |
| 68 | +!18 = !{!"m_OpenCLArgTypeQualifiersVec[0]", !""} |
| 69 | +!19 = !{!"m_OpenCLArgTypeQualifiersVec[1]", !""} |
| 70 | +!20 = !{!"m_OpenCLArgTypeQualifiersVec[2]", !""} |
| 71 | +!21 = !{void (i32 addrspace(1)*, i32)* @test, !22} |
| 72 | +!22 = !{!23} |
| 73 | +!23 = !{!"function_type", i32 0} |
0 commit comments