File: access_store.ll

package info (click to toggle)
spirv-llvm-translator-14 14.0.17-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,700 kB
  • sloc: cpp: 47,811; lisp: 3,704; sh: 153; python: 43; makefile: 41
file content (65 lines) | stat: -rw-r--r-- 3,784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
; RUN: llvm-as < %s -o %t.bc
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_KHR_cooperative_matrix -o %t.spv
; RUN: llvm-spirv %t.spv -to-text -o %t.spt
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV

; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM

; CHECK-SPIRV: TypeInt [[#TypeInt:]] 32 0
; CHECK-SPIRV-DAG: Constant [[#TypeInt]] [[#Const0:]] 0
; CHECK-SPIRV-DAG: Constant [[#TypeInt]] [[#Const1:]] 1 {{$}}
; CHECK-SPIRV-DAG: Constant [[#TypeInt]] [[#Const3:]] 3
; CHECK-SPIRV-DAG: Constant [[#TypeInt]] [[#Const12:]] 12
; CHECK-SPIRV-DAG: Constant [[#TypeInt]] [[#Const42:]] 42

; CHECK-SPIRV: TypeCooperativeMatrixKHR [[#TypeMatrix:]] [[#TypeInt]] [[#Const3]] [[#Const12]] [[#Const12]] [[#Const0]]
; CHECK-SPIRV: TypePointer [[#TypeMatrixPtr:]] 7 [[#TypeMatrix]]
; CHECK-SPIRV: TypePointer [[#TypeIntPtr:]] 7 [[#TypeInt]]

; CHECK-SPIRV: Variable [[#TypeMatrixPtr]] [[#VarMatrixPtr:]] 7
; CHECK-SPIRV: CompositeConstruct [[#TypeMatrix]] [[#Composite:]] [[#Const0]]
; CHECK-SPIRV: Store [[#VarMatrixPtr]] [[#Composite]]
; CHECK-SPIRV: AccessChain [[#TypeIntPtr]] [[#Res:]] [[#VarMatrixPtr]] [[#Const1]]
; CHECK-SPIRV: Store [[#Res]] [[#Const42]]

; CHECK-LLVM: %0 = alloca %spirv.CooperativeMatrixKHR._int_3_12_12_0 addrspace(1)*
; CHECK-LLVM: %Obj = call spir_func %spirv.CooperativeMatrixKHR._int_3_12_12_0 addrspace(1)* @_Z26__spirv_CompositeConstructi(i32 0)
; CHECK-LLVM: store %spirv.CooperativeMatrixKHR._int_3_12_12_0 addrspace(1)* %Obj, %spirv.CooperativeMatrixKHR._int_3_12_12_0 addrspace(1)** %0
; CHECK-LLVM: %call = call spir_func i32* @_Z19__spirv_AccessChainPPU3AS143__spirv_CooperativeMatrixKHR__int_3_12_12_0i(%spirv.CooperativeMatrixKHR._int_3_12_12_0 addrspace(1)** %0, i32 1)
; CHECK-LLVM: store i32 42, i32* %call

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "spir64-unknown-unknown"

%spirv.CooperativeMatrixKHR._int_3_12_12_0 = type { [12 x [12 x i32]]* }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3fooi(i32 noundef %idx) local_unnamed_addr #0 {
entry:
  %0 = alloca %spirv.CooperativeMatrixKHR._int_3_12_12_0*, align 8
  %Obj = tail call spir_func noundef %spirv.CooperativeMatrixKHR._int_3_12_12_0* @_Z26__spirv_CompositeConstruct(i32 noundef 0) #4
  store %spirv.CooperativeMatrixKHR._int_3_12_12_0* %Obj, %spirv.CooperativeMatrixKHR._int_3_12_12_0** %0, align 8
  %call = call noundef i32* @_Z19__spirv_AccessChainP6Matrixii(%spirv.CooperativeMatrixKHR._int_3_12_12_0** %0, i32 noundef 1)
  call void @_Z13__spirv_StorePii(i32* noundef %call, i32 noundef 42)
  ret void
}

declare dso_local spir_func noundef %spirv.CooperativeMatrixKHR._int_3_12_12_0* @_Z26__spirv_CompositeConstruct(i32 noundef) local_unnamed_addr #2

declare noundef i32* @_Z19__spirv_AccessChainP6Matrixii(%spirv.CooperativeMatrixKHR._int_3_12_12_0** noundef, i32 noundef) local_unnamed_addr #2

declare void @_Z13__spirv_StorePii(i32* noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1,!3, !4}
!llvm.ident = !{!5}

!0 = !{i32 7, !"Dwarf Version", i32 4}
!1 = !{i32 1, !"wchar_size", i32 4}
!3 = !{i32 7, !"PIE Level", i32 2}
!4 = !{i32 7, !"uwtable", i32 2}
!5 = !{!"clang version 16.0.0 (https://github.com/llvm/llvm-project.git 08d094a0e457360ad8b94b017d2dc277e697ca76)"}