| 1 |
; UNSUPPORTED: system-windows |
| 2 |
; REQUIRES: llvm-spirv, regkeys, dg2-supported |
| 3 |
|
| 4 |
; RUN: llvm-as %s -o %t.bc |
| 5 |
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_cache_controls -o %t.spv |
| 6 |
; RUN: ocloc compile -spirv_input -file %t.spv -device dg2 -options " -igc_opts 'ShaderDumpTranslationOnly=1'" 2>&1 | FileCheck %s --check-prefixes=CHECK-LLVM |
| 7 |
|
| 8 |
; CHECK-LLVM: %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %buffer, i64 1, !spirv.Decorations [[LoadMD:![0-9]+]] |
| 9 |
; CHECK-LLVM: load i32, i32 addrspace(1)* %arrayidx, align 4 |
| 10 |
|
| 11 |
; CHECK-LLVM: %arrayidx1 = getelementptr inbounds i32, i32 addrspace(1)* %buffer, i64 0, !spirv.Decorations [[StoreMD:![0-9]+]] |
| 12 |
; CHECK-LLVM: store i32 %0, i32 addrspace(1)* %arrayidx1, align 4 |
| 13 |
|
| 14 |
; CHECK-LLVM: [[LoadMD]] = !{[[CC0:![0-9]+]], [[CC1:![0-9]+]]} |
| 15 |
; CHECK-LLVM: [[CC0]] = !{i32 6442, i32 0, i32 1} |
| 16 |
; CHECK-LLVM: [[CC1]] = !{i32 6442, i32 1, i32 1} |
| 17 |
|
| 18 |
; CHECK-LLVM: [[StoreMD]] = !{[[CC2:![0-9]+]], [[CC3:![0-9]+]]} |
| 19 |
; CHECK-LLVM: [[CC2]] = !{i32 6443, i32 0, i32 1} |
| 20 |
; CHECK-LLVM: [[CC3]] = !{i32 6443, i32 1, i32 2} |
| 21 |
|
| 22 |
target triple = "spir64-unknown-unknown" |
| 23 |
|
| 24 |
define spir_kernel void @test(i32 addrspace(1)* %buffer) { |
| 25 |
entry: |
| 26 |
%arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %buffer, i64 1, !spirv.Decorations !3 |
| 27 |
%0 = load i32, i32 addrspace(1)* %arrayidx, align 4 |
| 28 |
%arrayidx1 = getelementptr inbounds i32, i32 addrspace(1)* %buffer, i64 0, !spirv.Decorations !6 |
| 29 |
store i32 %0, i32 addrspace(1)* %arrayidx1, align 4 |
| 30 |
ret void |
| 31 |
} |
| 32 |
|
| 33 |
!spirv.MemoryModel = !{!0} |
| 34 |
!spirv.Source = !{!1} |
| 35 |
!opencl.spir.version = !{!2} |
| 36 |
!opencl.ocl.version = !{!2} |
| 37 |
|
| 38 |
!0 = !{i32 2, i32 2} |
| 39 |
!1 = !{i32 3, i32 102000} |
| 40 |
!2 = !{i32 1, i32 2} |
| 41 |
!3 = !{!4, !5} |
| 42 |
!4 = !{i32 6442, i32 0, i32 1} ; {CacheControlLoadINTEL, CacheLevel=0, Cached} |
| 43 |
!5 = !{i32 6442, i32 1, i32 1} ; {CacheControlLoadINTEL, CacheLevel=1, Cached} |
| 44 |
!6 = !{!7, !8} |
| 45 |
!7 = !{i32 6443, i32 0, i32 1} ; {CacheControlStoreINTEL, CacheLevel=0, WriteThrough} |
| 46 |
!8 = !{i32 6443, i32 1, i32 2} ; {CacheControlStoreINTEL, CacheLevel=1, WriteBack} |