Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/vector_times_matrix.spt

raw
1 119734787 65536 458752 21 0
2 2 Capability Addresses
3 2 Capability Linkage
4 2 Capability Kernel
5 2 Capability Float64
6 2 Capability Matrix
7 3 MemoryModel 2 2
8 8 EntryPoint 6 20 "vector_times_matrix"
9 3 Source 3 102000
10 3 Name 12 "res"
11 3 Name 13 "lhs"
12 3 Name 14 "rhs"
13
14 2 TypeVoid 5
15 3 TypeFloat 6 32
16 4 TypeVector 7 6 4
17 4 TypeMatrix 8 7 4
18 4 TypePointer 9 7 8
19 4 TypePointer 10 7 7
20 6 TypeFunction 11 5 10 10 9
21
22 5 Function 5 20 0 11
23 3 FunctionParameter 10 12
24 3 FunctionParameter 10 13
25 3 FunctionParameter 9 14
26
27 2 Label 15
28 4 Load 7 16 13
29 4 Load 8 17 14
30 5 VectorTimesMatrix 7 18 16 17
31 3 Store 12 18
32 1 Return
33
34 1 FunctionEnd
35
36 ; RUN: llvm-spirv %s -to-binary -o %t.spv
37 ; RUN: spirv-val %t.spv
38 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.bc
39 ; RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-LLVM
40
41 ; CHECK-LLVM: %1 = load <4 x float>, ptr %lhs
42 ; CHECK-LLVM: %2 = load [4 x <4 x float>], ptr %rhs
43 ; CHECK-LLVM: %3 = extractelement <4 x float> %1, i32 0
44 ; CHECK-LLVM: %.splatinsert = insertelement <4 x float> poison, float %3, i64 0
45 ; CHECK-LLVM: %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
46 ; CHECK-LLVM: %4 = extractvalue [4 x <4 x float>] %2, 0
47 ; CHECK-LLVM: %5 = extractelement <4 x float> %4, i32 0
48 ; CHECK-LLVM: %6 = insertelement <4 x float> undef, float %5, i32 0
49 ; CHECK-LLVM: %7 = extractvalue [4 x <4 x float>] %2, 1
50 ; CHECK-LLVM: %8 = extractelement <4 x float> %7, i32 0
51 ; CHECK-LLVM: %9 = insertelement <4 x float> %6, float %8, i32 1
52 ; CHECK-LLVM: %10 = extractvalue [4 x <4 x float>] %2, 2
53 ; CHECK-LLVM: %11 = extractelement <4 x float> %10, i32 0
54 ; CHECK-LLVM: %12 = insertelement <4 x float> %9, float %11, i32 2
55 ; CHECK-LLVM: %13 = extractvalue [4 x <4 x float>] %2, 3
56 ; CHECK-LLVM: %14 = extractelement <4 x float> %13, i32 0
57 ; CHECK-LLVM: %15 = insertelement <4 x float> %12, float %14, i32 3
58 ; CHECK-LLVM: %16 = fmul <4 x float> %.splat, %15
59 ; CHECK-LLVM: %17 = fadd <4 x float> zeroinitializer, %16
60 ; CHECK-LLVM: %18 = extractelement <4 x float> %1, i32 1
61 ; CHECK-LLVM: %.splatinsert1 = insertelement <4 x float> poison, float %18, i64 0
62 ; CHECK-LLVM: %.splat2 = shufflevector <4 x float> %.splatinsert1, <4 x float> poison, <4 x i32> zeroinitializer
63 ; CHECK-LLVM: %19 = extractvalue [4 x <4 x float>] %2, 0
64 ; CHECK-LLVM: %20 = extractelement <4 x float> %19, i32 1
65 ; CHECK-LLVM: %21 = insertelement <4 x float> undef, float %20, i32 0
66 ; CHECK-LLVM: %22 = extractvalue [4 x <4 x float>] %2, 1
67 ; CHECK-LLVM: %23 = extractelement <4 x float> %22, i32 1
68 ; CHECK-LLVM: %24 = insertelement <4 x float> %21, float %23, i32 1
69 ; CHECK-LLVM: %25 = extractvalue [4 x <4 x float>] %2, 2
70 ; CHECK-LLVM: %26 = extractelement <4 x float> %25, i32 1
71 ; CHECK-LLVM: %27 = insertelement <4 x float> %24, float %26, i32 2
72 ; CHECK-LLVM: %28 = extractvalue [4 x <4 x float>] %2, 3
73 ; CHECK-LLVM: %29 = extractelement <4 x float> %28, i32 1
74 ; CHECK-LLVM: %30 = insertelement <4 x float> %27, float %29, i32 3
75 ; CHECK-LLVM: %31 = fmul <4 x float> %.splat2, %30
76 ; CHECK-LLVM: %32 = fadd <4 x float> %17, %31
77 ; CHECK-LLVM: %33 = extractelement <4 x float> %1, i32 2
78 ; CHECK-LLVM: %.splatinsert3 = insertelement <4 x float> poison, float %33, i64 0
79 ; CHECK-LLVM: %.splat4 = shufflevector <4 x float> %.splatinsert3, <4 x float> poison, <4 x i32> zeroinitializer
80 ; CHECK-LLVM: %34 = extractvalue [4 x <4 x float>] %2, 0
81 ; CHECK-LLVM: %35 = extractelement <4 x float> %34, i32 2
82 ; CHECK-LLVM: %36 = insertelement <4 x float> undef, float %35, i32 0
83 ; CHECK-LLVM: %37 = extractvalue [4 x <4 x float>] %2, 1
84 ; CHECK-LLVM: %38 = extractelement <4 x float> %37, i32 2
85 ; CHECK-LLVM: %39 = insertelement <4 x float> %36, float %38, i32 1
86 ; CHECK-LLVM: %40 = extractvalue [4 x <4 x float>] %2, 2
87 ; CHECK-LLVM: %41 = extractelement <4 x float> %40, i32 2
88 ; CHECK-LLVM: %42 = insertelement <4 x float> %39, float %41, i32 2
89 ; CHECK-LLVM: %43 = extractvalue [4 x <4 x float>] %2, 3
90 ; CHECK-LLVM: %44 = extractelement <4 x float> %43, i32 2
91 ; CHECK-LLVM: %45 = insertelement <4 x float> %42, float %44, i32 3
92 ; CHECK-LLVM: %46 = fmul <4 x float> %.splat4, %45
93 ; CHECK-LLVM: %47 = fadd <4 x float> %32, %46
94 ; CHECK-LLVM: %48 = extractelement <4 x float> %1, i32 3
95 ; CHECK-LLVM: %.splatinsert5 = insertelement <4 x float> poison, float %48, i64 0
96 ; CHECK-LLVM: %.splat6 = shufflevector <4 x float> %.splatinsert5, <4 x float> poison, <4 x i32> zeroinitializer
97 ; CHECK-LLVM: %49 = extractvalue [4 x <4 x float>] %2, 0
98 ; CHECK-LLVM: %50 = extractelement <4 x float> %49, i32 3
99 ; CHECK-LLVM: %51 = insertelement <4 x float> undef, float %50, i32 0
100 ; CHECK-LLVM: %52 = extractvalue [4 x <4 x float>] %2, 1
101 ; CHECK-LLVM: %53 = extractelement <4 x float> %52, i32 3
102 ; CHECK-LLVM: %54 = insertelement <4 x float> %51, float %53, i32 1
103 ; CHECK-LLVM: %55 = extractvalue [4 x <4 x float>] %2, 2
104 ; CHECK-LLVM: %56 = extractelement <4 x float> %55, i32 3
105 ; CHECK-LLVM: %57 = insertelement <4 x float> %54, float %56, i32 2
106 ; CHECK-LLVM: %58 = extractvalue [4 x <4 x float>] %2, 3
107 ; CHECK-LLVM: %59 = extractelement <4 x float> %58, i32 3
108 ; CHECK-LLVM: %60 = insertelement <4 x float> %57, float %59, i32 3
109 ; CHECK-LLVM: %61 = fmul <4 x float> %.splat6, %60
110 ; CHECK-LLVM: %62 = fadd <4 x float> %47, %61
111 ; CHECK-LLVM: store <4 x float> %62, ptr %res
112 ; CHECK-LLVM: ret void