1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; REQUIRES: aarch64-registered-target
4 ; This test needs to be target specific due to the cost estimate in the output.
6 ; RUN: opt -passes='lower-matrix-intrinsics' -S < %s | FileCheck %s
7 ; RUN: opt -passes='lower-matrix-intrinsics' -S -o /dev/null -pass-remarks-output=%t < %s && FileCheck --input-file %t --check-prefix=REMARK %s
9 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
10 target triple = "aarch64-apple-ios"
12 define void @double_transpose(ptr %A, ptr %B) {
13 ; REMARK: Pass: lower-matrix-intrinsics
14 ; REMARK-NEXT: Name: matrix-lowered
15 ; REMARK-NEXT: Function: double_transpose
17 ; REMARK-NEXT: - String: 'Lowered with '
18 ; REMARK-NEXT: - NumStores: '6'
19 ; REMARK-NEXT: - String: ' stores, '
20 ; REMARK-NEXT: - NumLoads: '6'
21 ; REMARK-NEXT: - String: ' loads, '
22 ; REMARK-NEXT: - NumComputeOps: '0'
23 ; REMARK-NEXT: - String: ' compute ops, '
24 ; REMARK-NEXT: - NumExposedTransposes: '0'
25 ; REMARK-NEXT: - String: ' exposed transposes'
26 ; REMARK-NEXT: - String: |
28 ; REMARK-NEXT: load(addr %A),
29 ; REMARK-NEXT: addr %B)
30 ; CHECK-LABEL: @double_transpose(
32 ; CHECK-NEXT: [[COL_LOAD:%.*]] = load <3 x double>, ptr [[A:%.*]], align 16
33 ; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr double, ptr [[A]], i64 3
34 ; CHECK-NEXT: [[COL_LOAD1:%.*]] = load <3 x double>, ptr [[VEC_GEP]], align 8
35 ; CHECK-NEXT: [[VEC_GEP2:%.*]] = getelementptr double, ptr [[A]], i64 6
36 ; CHECK-NEXT: [[COL_LOAD3:%.*]] = load <3 x double>, ptr [[VEC_GEP2]], align 16
37 ; CHECK-NEXT: store <3 x double> [[COL_LOAD]], ptr [[B:%.*]], align 16
38 ; CHECK-NEXT: [[VEC_GEP4:%.*]] = getelementptr double, ptr [[B]], i64 3
39 ; CHECK-NEXT: store <3 x double> [[COL_LOAD1]], ptr [[VEC_GEP4]], align 8
40 ; CHECK-NEXT: [[VEC_GEP5:%.*]] = getelementptr double, ptr [[B]], i64 6
41 ; CHECK-NEXT: store <3 x double> [[COL_LOAD3]], ptr [[VEC_GEP5]], align 16
42 ; CHECK-NEXT: ret void
45 %a = load <9 x double>, ptr %A, align 16
46 %at = call <9 x double> @llvm.matrix.transpose.v9f64.v9f64(<9 x double> %a, i32 3, i32 3)
47 %att = call <9 x double> @llvm.matrix.transpose.v9f64.v9f64(<9 x double> %at, i32 3, i32 3)
48 store <9 x double> %att, ptr %B, align 16
52 define void @multiply_ntt(ptr %A, ptr %B, ptr %C, ptr %R) {
53 ; REMARK: Pass: lower-matrix-intrinsics
54 ; REMARK-NEXT: Name: matrix-lowered
55 ; REMARK-NEXT: Function: multiply_ntt
57 ; REMARK-NEXT: - String: 'Lowered with '
58 ; REMARK-NEXT: - NumStores: '4'
59 ; REMARK-NEXT: - String: ' stores, '
60 ; REMARK-NEXT: - NumLoads: '10'
61 ; REMARK-NEXT: - String: ' loads, '
62 ; REMARK-NEXT: - NumComputeOps: '38'
63 ; REMARK-NEXT: - String: ' compute ops, '
64 ; REMARK-NEXT: - NumExposedTransposes: '0'
65 ; REMARK-NEXT: - String: ' exposed transposes'
66 ; REMARK-NEXT: - String: |
68 ; REMARK-NEXT: multiply.2x3.3x4.double(
69 ; REMARK-NEXT: load(addr %A),
70 ; REMARK-NEXT: transpose.4x3.double(multiply.4x2.2x3.double(
71 ; REMARK-NEXT: load(addr %C),
72 ; REMARK-NEXT: load(addr %B)))),
73 ; REMARK-NEXT: addr %R)
74 ; CHECK-LABEL: @multiply_ntt(
76 ; CHECK-NEXT: [[COL_LOAD:%.*]] = load <2 x double>, ptr [[A:%.*]], align 16
77 ; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr double, ptr [[A]], i64 2
78 ; CHECK-NEXT: [[COL_LOAD39:%.*]] = load <2 x double>, ptr [[VEC_GEP]], align 16
79 ; CHECK-NEXT: [[VEC_GEP40:%.*]] = getelementptr double, ptr [[A]], i64 4
80 ; CHECK-NEXT: [[COL_LOAD41:%.*]] = load <2 x double>, ptr [[VEC_GEP40]], align 16
81 ; CHECK-NEXT: [[TMP0:%.*]] = shufflevector <2 x double> [[COL_LOAD]], <2 x double> [[COL_LOAD39]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
82 ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x double> [[COL_LOAD41]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
83 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x double> [[TMP0]], <4 x double> [[TMP1]], <6 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5>
84 ; CHECK-NEXT: [[COL_LOAD42:%.*]] = load <2 x double>, ptr [[B:%.*]], align 16
85 ; CHECK-NEXT: [[VEC_GEP43:%.*]] = getelementptr double, ptr [[B]], i64 2
86 ; CHECK-NEXT: [[COL_LOAD44:%.*]] = load <2 x double>, ptr [[VEC_GEP43]], align 16
87 ; CHECK-NEXT: [[VEC_GEP45:%.*]] = getelementptr double, ptr [[B]], i64 4
88 ; CHECK-NEXT: [[COL_LOAD46:%.*]] = load <2 x double>, ptr [[VEC_GEP45]], align 16
89 ; CHECK-NEXT: [[COL_LOAD47:%.*]] = load <4 x double>, ptr [[C:%.*]], align 16
90 ; CHECK-NEXT: [[VEC_GEP48:%.*]] = getelementptr double, ptr [[C]], i64 4
91 ; CHECK-NEXT: [[COL_LOAD49:%.*]] = load <4 x double>, ptr [[VEC_GEP48]], align 16
92 ; CHECK-NEXT: [[BLOCK50:%.*]] = shufflevector <4 x double> [[COL_LOAD47]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
93 ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x double> [[COL_LOAD42]], i64 0
94 ; CHECK-NEXT: [[SPLAT_SPLATINSERT51:%.*]] = insertelement <2 x double> poison, double [[TMP3]], i64 0
95 ; CHECK-NEXT: [[SPLAT_SPLAT52:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT51]], <2 x double> poison, <2 x i32> zeroinitializer
96 ; CHECK-NEXT: [[TMP4:%.*]] = fmul <2 x double> [[BLOCK50]], [[SPLAT_SPLAT52]]
97 ; CHECK-NEXT: [[BLOCK53:%.*]] = shufflevector <4 x double> [[COL_LOAD49]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
98 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x double> [[COL_LOAD42]], i64 1
99 ; CHECK-NEXT: [[SPLAT_SPLATINSERT54:%.*]] = insertelement <2 x double> poison, double [[TMP5]], i64 0
100 ; CHECK-NEXT: [[SPLAT_SPLAT55:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT54]], <2 x double> poison, <2 x i32> zeroinitializer
101 ; CHECK-NEXT: [[TMP6:%.*]] = fmul <2 x double> [[BLOCK53]], [[SPLAT_SPLAT55]]
102 ; CHECK-NEXT: [[TMP7:%.*]] = fadd <2 x double> [[TMP4]], [[TMP6]]
103 ; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <2 x double> [[TMP7]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
104 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <4 x double> poison, <4 x double> [[TMP8]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
105 ; CHECK-NEXT: [[BLOCK56:%.*]] = shufflevector <4 x double> [[COL_LOAD47]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
106 ; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x double> [[COL_LOAD42]], i64 0
107 ; CHECK-NEXT: [[SPLAT_SPLATINSERT57:%.*]] = insertelement <2 x double> poison, double [[TMP10]], i64 0
108 ; CHECK-NEXT: [[SPLAT_SPLAT58:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT57]], <2 x double> poison, <2 x i32> zeroinitializer
109 ; CHECK-NEXT: [[TMP11:%.*]] = fmul <2 x double> [[BLOCK56]], [[SPLAT_SPLAT58]]
110 ; CHECK-NEXT: [[BLOCK59:%.*]] = shufflevector <4 x double> [[COL_LOAD49]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
111 ; CHECK-NEXT: [[TMP12:%.*]] = extractelement <2 x double> [[COL_LOAD42]], i64 1
112 ; CHECK-NEXT: [[SPLAT_SPLATINSERT60:%.*]] = insertelement <2 x double> poison, double [[TMP12]], i64 0
113 ; CHECK-NEXT: [[SPLAT_SPLAT61:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT60]], <2 x double> poison, <2 x i32> zeroinitializer
114 ; CHECK-NEXT: [[TMP13:%.*]] = fmul <2 x double> [[BLOCK59]], [[SPLAT_SPLAT61]]
115 ; CHECK-NEXT: [[TMP14:%.*]] = fadd <2 x double> [[TMP11]], [[TMP13]]
116 ; CHECK-NEXT: [[TMP15:%.*]] = shufflevector <2 x double> [[TMP14]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
117 ; CHECK-NEXT: [[TMP16:%.*]] = shufflevector <4 x double> [[TMP9]], <4 x double> [[TMP15]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
118 ; CHECK-NEXT: [[BLOCK62:%.*]] = shufflevector <4 x double> [[COL_LOAD47]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
119 ; CHECK-NEXT: [[TMP17:%.*]] = extractelement <2 x double> [[COL_LOAD44]], i64 0
120 ; CHECK-NEXT: [[SPLAT_SPLATINSERT63:%.*]] = insertelement <2 x double> poison, double [[TMP17]], i64 0
121 ; CHECK-NEXT: [[SPLAT_SPLAT64:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT63]], <2 x double> poison, <2 x i32> zeroinitializer
122 ; CHECK-NEXT: [[TMP18:%.*]] = fmul <2 x double> [[BLOCK62]], [[SPLAT_SPLAT64]]
123 ; CHECK-NEXT: [[BLOCK65:%.*]] = shufflevector <4 x double> [[COL_LOAD49]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
124 ; CHECK-NEXT: [[TMP19:%.*]] = extractelement <2 x double> [[COL_LOAD44]], i64 1
125 ; CHECK-NEXT: [[SPLAT_SPLATINSERT66:%.*]] = insertelement <2 x double> poison, double [[TMP19]], i64 0
126 ; CHECK-NEXT: [[SPLAT_SPLAT67:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT66]], <2 x double> poison, <2 x i32> zeroinitializer
127 ; CHECK-NEXT: [[TMP20:%.*]] = fmul <2 x double> [[BLOCK65]], [[SPLAT_SPLAT67]]
128 ; CHECK-NEXT: [[TMP21:%.*]] = fadd <2 x double> [[TMP18]], [[TMP20]]
129 ; CHECK-NEXT: [[TMP22:%.*]] = shufflevector <2 x double> [[TMP21]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
130 ; CHECK-NEXT: [[TMP23:%.*]] = shufflevector <4 x double> poison, <4 x double> [[TMP22]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
131 ; CHECK-NEXT: [[BLOCK68:%.*]] = shufflevector <4 x double> [[COL_LOAD47]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
132 ; CHECK-NEXT: [[TMP24:%.*]] = extractelement <2 x double> [[COL_LOAD44]], i64 0
133 ; CHECK-NEXT: [[SPLAT_SPLATINSERT69:%.*]] = insertelement <2 x double> poison, double [[TMP24]], i64 0
134 ; CHECK-NEXT: [[SPLAT_SPLAT70:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT69]], <2 x double> poison, <2 x i32> zeroinitializer
135 ; CHECK-NEXT: [[TMP25:%.*]] = fmul <2 x double> [[BLOCK68]], [[SPLAT_SPLAT70]]
136 ; CHECK-NEXT: [[BLOCK71:%.*]] = shufflevector <4 x double> [[COL_LOAD49]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
137 ; CHECK-NEXT: [[TMP26:%.*]] = extractelement <2 x double> [[COL_LOAD44]], i64 1
138 ; CHECK-NEXT: [[SPLAT_SPLATINSERT72:%.*]] = insertelement <2 x double> poison, double [[TMP26]], i64 0
139 ; CHECK-NEXT: [[SPLAT_SPLAT73:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT72]], <2 x double> poison, <2 x i32> zeroinitializer
140 ; CHECK-NEXT: [[TMP27:%.*]] = fmul <2 x double> [[BLOCK71]], [[SPLAT_SPLAT73]]
141 ; CHECK-NEXT: [[TMP28:%.*]] = fadd <2 x double> [[TMP25]], [[TMP27]]
142 ; CHECK-NEXT: [[TMP29:%.*]] = shufflevector <2 x double> [[TMP28]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
143 ; CHECK-NEXT: [[TMP30:%.*]] = shufflevector <4 x double> [[TMP23]], <4 x double> [[TMP29]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
144 ; CHECK-NEXT: [[BLOCK74:%.*]] = shufflevector <4 x double> [[COL_LOAD47]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
145 ; CHECK-NEXT: [[TMP31:%.*]] = extractelement <2 x double> [[COL_LOAD46]], i64 0
146 ; CHECK-NEXT: [[SPLAT_SPLATINSERT75:%.*]] = insertelement <2 x double> poison, double [[TMP31]], i64 0
147 ; CHECK-NEXT: [[SPLAT_SPLAT76:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT75]], <2 x double> poison, <2 x i32> zeroinitializer
148 ; CHECK-NEXT: [[TMP32:%.*]] = fmul <2 x double> [[BLOCK74]], [[SPLAT_SPLAT76]]
149 ; CHECK-NEXT: [[BLOCK77:%.*]] = shufflevector <4 x double> [[COL_LOAD49]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
150 ; CHECK-NEXT: [[TMP33:%.*]] = extractelement <2 x double> [[COL_LOAD46]], i64 1
151 ; CHECK-NEXT: [[SPLAT_SPLATINSERT78:%.*]] = insertelement <2 x double> poison, double [[TMP33]], i64 0
152 ; CHECK-NEXT: [[SPLAT_SPLAT79:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT78]], <2 x double> poison, <2 x i32> zeroinitializer
153 ; CHECK-NEXT: [[TMP34:%.*]] = fmul <2 x double> [[BLOCK77]], [[SPLAT_SPLAT79]]
154 ; CHECK-NEXT: [[TMP35:%.*]] = fadd <2 x double> [[TMP32]], [[TMP34]]
155 ; CHECK-NEXT: [[TMP36:%.*]] = shufflevector <2 x double> [[TMP35]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
156 ; CHECK-NEXT: [[TMP37:%.*]] = shufflevector <4 x double> poison, <4 x double> [[TMP36]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
157 ; CHECK-NEXT: [[BLOCK80:%.*]] = shufflevector <4 x double> [[COL_LOAD47]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
158 ; CHECK-NEXT: [[TMP38:%.*]] = extractelement <2 x double> [[COL_LOAD46]], i64 0
159 ; CHECK-NEXT: [[SPLAT_SPLATINSERT81:%.*]] = insertelement <2 x double> poison, double [[TMP38]], i64 0
160 ; CHECK-NEXT: [[SPLAT_SPLAT82:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT81]], <2 x double> poison, <2 x i32> zeroinitializer
161 ; CHECK-NEXT: [[TMP39:%.*]] = fmul <2 x double> [[BLOCK80]], [[SPLAT_SPLAT82]]
162 ; CHECK-NEXT: [[BLOCK83:%.*]] = shufflevector <4 x double> [[COL_LOAD49]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
163 ; CHECK-NEXT: [[TMP40:%.*]] = extractelement <2 x double> [[COL_LOAD46]], i64 1
164 ; CHECK-NEXT: [[SPLAT_SPLATINSERT84:%.*]] = insertelement <2 x double> poison, double [[TMP40]], i64 0
165 ; CHECK-NEXT: [[SPLAT_SPLAT85:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT84]], <2 x double> poison, <2 x i32> zeroinitializer
166 ; CHECK-NEXT: [[TMP41:%.*]] = fmul <2 x double> [[BLOCK83]], [[SPLAT_SPLAT85]]
167 ; CHECK-NEXT: [[TMP42:%.*]] = fadd <2 x double> [[TMP39]], [[TMP41]]
168 ; CHECK-NEXT: [[TMP43:%.*]] = shufflevector <2 x double> [[TMP42]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
169 ; CHECK-NEXT: [[TMP44:%.*]] = shufflevector <4 x double> [[TMP37]], <4 x double> [[TMP43]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
170 ; CHECK-NEXT: [[TMP45:%.*]] = shufflevector <4 x double> [[TMP16]], <4 x double> [[TMP30]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
171 ; CHECK-NEXT: [[TMP46:%.*]] = shufflevector <4 x double> [[TMP44]], <4 x double> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>
172 ; CHECK-NEXT: [[TMP47:%.*]] = shufflevector <8 x double> [[TMP45]], <8 x double> [[TMP46]], <12 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11>
173 ; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <6 x double> [[TMP2]], <6 x double> poison, <2 x i32> <i32 0, i32 1>
174 ; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <6 x double> [[TMP2]], <6 x double> poison, <2 x i32> <i32 2, i32 3>
175 ; CHECK-NEXT: [[SPLIT2:%.*]] = shufflevector <6 x double> [[TMP2]], <6 x double> poison, <2 x i32> <i32 4, i32 5>
176 ; CHECK-NEXT: [[SPLIT3:%.*]] = shufflevector <12 x double> [[TMP47]], <12 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
177 ; CHECK-NEXT: [[SPLIT4:%.*]] = shufflevector <12 x double> [[TMP47]], <12 x double> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
178 ; CHECK-NEXT: [[SPLIT5:%.*]] = shufflevector <12 x double> [[TMP47]], <12 x double> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
179 ; CHECK-NEXT: [[BLOCK:%.*]] = shufflevector <2 x double> [[SPLIT]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
180 ; CHECK-NEXT: [[TMP48:%.*]] = extractelement <4 x double> [[SPLIT3]], i64 0
181 ; CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <2 x double> poison, double [[TMP48]], i64 0
182 ; CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT]], <2 x double> poison, <2 x i32> zeroinitializer
183 ; CHECK-NEXT: [[TMP49:%.*]] = fmul <2 x double> [[BLOCK]], [[SPLAT_SPLAT]]
184 ; CHECK-NEXT: [[BLOCK6:%.*]] = shufflevector <2 x double> [[SPLIT1]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
185 ; CHECK-NEXT: [[TMP50:%.*]] = extractelement <4 x double> [[SPLIT4]], i64 0
186 ; CHECK-NEXT: [[SPLAT_SPLATINSERT7:%.*]] = insertelement <2 x double> poison, double [[TMP50]], i64 0
187 ; CHECK-NEXT: [[SPLAT_SPLAT8:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT7]], <2 x double> poison, <2 x i32> zeroinitializer
188 ; CHECK-NEXT: [[TMP51:%.*]] = fmul <2 x double> [[BLOCK6]], [[SPLAT_SPLAT8]]
189 ; CHECK-NEXT: [[TMP52:%.*]] = fadd <2 x double> [[TMP49]], [[TMP51]]
190 ; CHECK-NEXT: [[BLOCK9:%.*]] = shufflevector <2 x double> [[SPLIT2]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
191 ; CHECK-NEXT: [[TMP53:%.*]] = extractelement <4 x double> [[SPLIT5]], i64 0
192 ; CHECK-NEXT: [[SPLAT_SPLATINSERT10:%.*]] = insertelement <2 x double> poison, double [[TMP53]], i64 0
193 ; CHECK-NEXT: [[SPLAT_SPLAT11:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT10]], <2 x double> poison, <2 x i32> zeroinitializer
194 ; CHECK-NEXT: [[TMP54:%.*]] = fmul <2 x double> [[BLOCK9]], [[SPLAT_SPLAT11]]
195 ; CHECK-NEXT: [[TMP55:%.*]] = fadd <2 x double> [[TMP52]], [[TMP54]]
196 ; CHECK-NEXT: [[TMP56:%.*]] = shufflevector <2 x double> [[TMP55]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
197 ; CHECK-NEXT: [[TMP57:%.*]] = shufflevector <2 x double> poison, <2 x double> [[TMP56]], <2 x i32> <i32 2, i32 3>
198 ; CHECK-NEXT: [[BLOCK12:%.*]] = shufflevector <2 x double> [[SPLIT]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
199 ; CHECK-NEXT: [[TMP58:%.*]] = extractelement <4 x double> [[SPLIT3]], i64 1
200 ; CHECK-NEXT: [[SPLAT_SPLATINSERT13:%.*]] = insertelement <2 x double> poison, double [[TMP58]], i64 0
201 ; CHECK-NEXT: [[SPLAT_SPLAT14:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT13]], <2 x double> poison, <2 x i32> zeroinitializer
202 ; CHECK-NEXT: [[TMP59:%.*]] = fmul <2 x double> [[BLOCK12]], [[SPLAT_SPLAT14]]
203 ; CHECK-NEXT: [[BLOCK15:%.*]] = shufflevector <2 x double> [[SPLIT1]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
204 ; CHECK-NEXT: [[TMP60:%.*]] = extractelement <4 x double> [[SPLIT4]], i64 1
205 ; CHECK-NEXT: [[SPLAT_SPLATINSERT16:%.*]] = insertelement <2 x double> poison, double [[TMP60]], i64 0
206 ; CHECK-NEXT: [[SPLAT_SPLAT17:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT16]], <2 x double> poison, <2 x i32> zeroinitializer
207 ; CHECK-NEXT: [[TMP61:%.*]] = fmul <2 x double> [[BLOCK15]], [[SPLAT_SPLAT17]]
208 ; CHECK-NEXT: [[TMP62:%.*]] = fadd <2 x double> [[TMP59]], [[TMP61]]
209 ; CHECK-NEXT: [[BLOCK18:%.*]] = shufflevector <2 x double> [[SPLIT2]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
210 ; CHECK-NEXT: [[TMP63:%.*]] = extractelement <4 x double> [[SPLIT5]], i64 1
211 ; CHECK-NEXT: [[SPLAT_SPLATINSERT19:%.*]] = insertelement <2 x double> poison, double [[TMP63]], i64 0
212 ; CHECK-NEXT: [[SPLAT_SPLAT20:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT19]], <2 x double> poison, <2 x i32> zeroinitializer
213 ; CHECK-NEXT: [[TMP64:%.*]] = fmul <2 x double> [[BLOCK18]], [[SPLAT_SPLAT20]]
214 ; CHECK-NEXT: [[TMP65:%.*]] = fadd <2 x double> [[TMP62]], [[TMP64]]
215 ; CHECK-NEXT: [[TMP66:%.*]] = shufflevector <2 x double> [[TMP65]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
216 ; CHECK-NEXT: [[TMP67:%.*]] = shufflevector <2 x double> poison, <2 x double> [[TMP66]], <2 x i32> <i32 2, i32 3>
217 ; CHECK-NEXT: [[BLOCK21:%.*]] = shufflevector <2 x double> [[SPLIT]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
218 ; CHECK-NEXT: [[TMP68:%.*]] = extractelement <4 x double> [[SPLIT3]], i64 2
219 ; CHECK-NEXT: [[SPLAT_SPLATINSERT22:%.*]] = insertelement <2 x double> poison, double [[TMP68]], i64 0
220 ; CHECK-NEXT: [[SPLAT_SPLAT23:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT22]], <2 x double> poison, <2 x i32> zeroinitializer
221 ; CHECK-NEXT: [[TMP69:%.*]] = fmul <2 x double> [[BLOCK21]], [[SPLAT_SPLAT23]]
222 ; CHECK-NEXT: [[BLOCK24:%.*]] = shufflevector <2 x double> [[SPLIT1]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
223 ; CHECK-NEXT: [[TMP70:%.*]] = extractelement <4 x double> [[SPLIT4]], i64 2
224 ; CHECK-NEXT: [[SPLAT_SPLATINSERT25:%.*]] = insertelement <2 x double> poison, double [[TMP70]], i64 0
225 ; CHECK-NEXT: [[SPLAT_SPLAT26:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT25]], <2 x double> poison, <2 x i32> zeroinitializer
226 ; CHECK-NEXT: [[TMP71:%.*]] = fmul <2 x double> [[BLOCK24]], [[SPLAT_SPLAT26]]
227 ; CHECK-NEXT: [[TMP72:%.*]] = fadd <2 x double> [[TMP69]], [[TMP71]]
228 ; CHECK-NEXT: [[BLOCK27:%.*]] = shufflevector <2 x double> [[SPLIT2]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
229 ; CHECK-NEXT: [[TMP73:%.*]] = extractelement <4 x double> [[SPLIT5]], i64 2
230 ; CHECK-NEXT: [[SPLAT_SPLATINSERT28:%.*]] = insertelement <2 x double> poison, double [[TMP73]], i64 0
231 ; CHECK-NEXT: [[SPLAT_SPLAT29:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT28]], <2 x double> poison, <2 x i32> zeroinitializer
232 ; CHECK-NEXT: [[TMP74:%.*]] = fmul <2 x double> [[BLOCK27]], [[SPLAT_SPLAT29]]
233 ; CHECK-NEXT: [[TMP75:%.*]] = fadd <2 x double> [[TMP72]], [[TMP74]]
234 ; CHECK-NEXT: [[TMP76:%.*]] = shufflevector <2 x double> [[TMP75]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
235 ; CHECK-NEXT: [[TMP77:%.*]] = shufflevector <2 x double> poison, <2 x double> [[TMP76]], <2 x i32> <i32 2, i32 3>
236 ; CHECK-NEXT: [[BLOCK30:%.*]] = shufflevector <2 x double> [[SPLIT]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
237 ; CHECK-NEXT: [[TMP78:%.*]] = extractelement <4 x double> [[SPLIT3]], i64 3
238 ; CHECK-NEXT: [[SPLAT_SPLATINSERT31:%.*]] = insertelement <2 x double> poison, double [[TMP78]], i64 0
239 ; CHECK-NEXT: [[SPLAT_SPLAT32:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT31]], <2 x double> poison, <2 x i32> zeroinitializer
240 ; CHECK-NEXT: [[TMP79:%.*]] = fmul <2 x double> [[BLOCK30]], [[SPLAT_SPLAT32]]
241 ; CHECK-NEXT: [[BLOCK33:%.*]] = shufflevector <2 x double> [[SPLIT1]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
242 ; CHECK-NEXT: [[TMP80:%.*]] = extractelement <4 x double> [[SPLIT4]], i64 3
243 ; CHECK-NEXT: [[SPLAT_SPLATINSERT34:%.*]] = insertelement <2 x double> poison, double [[TMP80]], i64 0
244 ; CHECK-NEXT: [[SPLAT_SPLAT35:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT34]], <2 x double> poison, <2 x i32> zeroinitializer
245 ; CHECK-NEXT: [[TMP81:%.*]] = fmul <2 x double> [[BLOCK33]], [[SPLAT_SPLAT35]]
246 ; CHECK-NEXT: [[TMP82:%.*]] = fadd <2 x double> [[TMP79]], [[TMP81]]
247 ; CHECK-NEXT: [[BLOCK36:%.*]] = shufflevector <2 x double> [[SPLIT2]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
248 ; CHECK-NEXT: [[TMP83:%.*]] = extractelement <4 x double> [[SPLIT5]], i64 3
249 ; CHECK-NEXT: [[SPLAT_SPLATINSERT37:%.*]] = insertelement <2 x double> poison, double [[TMP83]], i64 0
250 ; CHECK-NEXT: [[SPLAT_SPLAT38:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT37]], <2 x double> poison, <2 x i32> zeroinitializer
251 ; CHECK-NEXT: [[TMP84:%.*]] = fmul <2 x double> [[BLOCK36]], [[SPLAT_SPLAT38]]
252 ; CHECK-NEXT: [[TMP85:%.*]] = fadd <2 x double> [[TMP82]], [[TMP84]]
253 ; CHECK-NEXT: [[TMP86:%.*]] = shufflevector <2 x double> [[TMP85]], <2 x double> poison, <2 x i32> <i32 0, i32 1>
254 ; CHECK-NEXT: [[TMP87:%.*]] = shufflevector <2 x double> poison, <2 x double> [[TMP86]], <2 x i32> <i32 2, i32 3>
255 ; CHECK-NEXT: store <2 x double> [[TMP57]], ptr [[R:%.*]], align 16
256 ; CHECK-NEXT: [[VEC_GEP86:%.*]] = getelementptr double, ptr [[R]], i64 2
257 ; CHECK-NEXT: store <2 x double> [[TMP67]], ptr [[VEC_GEP86]], align 16
258 ; CHECK-NEXT: [[VEC_GEP87:%.*]] = getelementptr double, ptr [[R]], i64 4
259 ; CHECK-NEXT: store <2 x double> [[TMP77]], ptr [[VEC_GEP87]], align 16
260 ; CHECK-NEXT: [[VEC_GEP88:%.*]] = getelementptr double, ptr [[R]], i64 6
261 ; CHECK-NEXT: store <2 x double> [[TMP87]], ptr [[VEC_GEP88]], align 16
262 ; CHECK-NEXT: ret void
265 %a = load <6 x double>, ptr %A, align 16
266 %b = load <6 x double>, ptr %B, align 16
267 %c = load <8 x double>, ptr %C, align 16
268 %b_t = call <6 x double> @llvm.matrix.transpose.v6f64.v6f64(<6 x double> %b, i32 2, i32 3)
269 %c_t = call <8 x double> @llvm.matrix.transpose.v8f64.v8f64(<8 x double> %c, i32 4, i32 2)
270 %m1 = call <12 x double> @llvm.matrix.multiply.v12f64.v6f64.v8f64(<6 x double> %b_t, <8 x double> %c_t, i32 3, i32 2, i32 4)
271 %m2 = call <8 x double> @llvm.matrix.multiply.v8f64.v6f64.v12f64(<6 x double> %a, <12 x double> %m1, i32 2, i32 3, i32 4)
272 store <8 x double> %m2, ptr %R, align 16
276 define void @multiply_tt_t(ptr %A, ptr %B, ptr %C) {
277 ; REMARK: Pass: lower-matrix-intrinsics
278 ; REMARK-NEXT: Name: matrix-lowered
279 ; REMARK-NEXT: Function: multiply_tt_t
281 ; REMARK-NEXT: - String: 'Lowered with '
282 ; REMARK-NEXT: - NumStores: '6'
283 ; REMARK-NEXT: - String: ' stores, '
284 ; REMARK-NEXT: - NumLoads: '12'
285 ; REMARK-NEXT: - String: ' loads, '
286 ; REMARK-NEXT: - NumComputeOps: '30'
287 ; REMARK-NEXT: - String: ' compute ops, '
288 ; REMARK-NEXT: - NumExposedTransposes: '0'
289 ; REMARK-NEXT: - String: ' exposed transposes'
290 ; REMARK-NEXT: - String: |
292 ; REMARK-NEXT: multiply.3x3.3x3.double(
293 ; REMARK-NEXT: load(addr %B),
294 ; REMARK-NEXT: load(addr %A)),
295 ; REMARK-NEXT: addr %C)
296 ; CHECK-LABEL: @multiply_tt_t(
298 ; CHECK-NEXT: [[COL_LOAD:%.*]] = load <3 x double>, ptr [[A:%.*]], align 16
299 ; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr double, ptr [[A]], i64 3
300 ; CHECK-NEXT: [[COL_LOAD1:%.*]] = load <3 x double>, ptr [[VEC_GEP]], align 8
301 ; CHECK-NEXT: [[VEC_GEP2:%.*]] = getelementptr double, ptr [[A]], i64 6
302 ; CHECK-NEXT: [[COL_LOAD3:%.*]] = load <3 x double>, ptr [[VEC_GEP2]], align 16
303 ; CHECK-NEXT: [[COL_LOAD4:%.*]] = load <3 x double>, ptr [[B:%.*]], align 16
304 ; CHECK-NEXT: [[VEC_GEP5:%.*]] = getelementptr double, ptr [[B]], i64 3
305 ; CHECK-NEXT: [[COL_LOAD6:%.*]] = load <3 x double>, ptr [[VEC_GEP5]], align 8
306 ; CHECK-NEXT: [[VEC_GEP7:%.*]] = getelementptr double, ptr [[B]], i64 6
307 ; CHECK-NEXT: [[COL_LOAD8:%.*]] = load <3 x double>, ptr [[VEC_GEP7]], align 16
308 ; CHECK-NEXT: [[BLOCK:%.*]] = shufflevector <3 x double> [[COL_LOAD4]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
309 ; CHECK-NEXT: [[TMP0:%.*]] = extractelement <3 x double> [[COL_LOAD]], i64 0
310 ; CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <2 x double> poison, double [[TMP0]], i64 0
311 ; CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT]], <2 x double> poison, <2 x i32> zeroinitializer
312 ; CHECK-NEXT: [[TMP1:%.*]] = fmul <2 x double> [[BLOCK]], [[SPLAT_SPLAT]]
313 ; CHECK-NEXT: [[BLOCK9:%.*]] = shufflevector <3 x double> [[COL_LOAD6]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
314 ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <3 x double> [[COL_LOAD]], i64 1
315 ; CHECK-NEXT: [[SPLAT_SPLATINSERT10:%.*]] = insertelement <2 x double> poison, double [[TMP2]], i64 0
316 ; CHECK-NEXT: [[SPLAT_SPLAT11:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT10]], <2 x double> poison, <2 x i32> zeroinitializer
317 ; CHECK-NEXT: [[TMP3:%.*]] = fmul <2 x double> [[BLOCK9]], [[SPLAT_SPLAT11]]
318 ; CHECK-NEXT: [[TMP4:%.*]] = fadd <2 x double> [[TMP1]], [[TMP3]]
319 ; CHECK-NEXT: [[BLOCK12:%.*]] = shufflevector <3 x double> [[COL_LOAD8]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
320 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <3 x double> [[COL_LOAD]], i64 2
321 ; CHECK-NEXT: [[SPLAT_SPLATINSERT13:%.*]] = insertelement <2 x double> poison, double [[TMP5]], i64 0
322 ; CHECK-NEXT: [[SPLAT_SPLAT14:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT13]], <2 x double> poison, <2 x i32> zeroinitializer
323 ; CHECK-NEXT: [[TMP6:%.*]] = fmul <2 x double> [[BLOCK12]], [[SPLAT_SPLAT14]]
324 ; CHECK-NEXT: [[TMP7:%.*]] = fadd <2 x double> [[TMP4]], [[TMP6]]
325 ; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <2 x double> [[TMP7]], <2 x double> poison, <3 x i32> <i32 0, i32 1, i32 poison>
326 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <3 x double> poison, <3 x double> [[TMP8]], <3 x i32> <i32 3, i32 4, i32 2>
327 ; CHECK-NEXT: [[BLOCK15:%.*]] = shufflevector <3 x double> [[COL_LOAD4]], <3 x double> poison, <1 x i32> <i32 2>
328 ; CHECK-NEXT: [[TMP10:%.*]] = extractelement <3 x double> [[COL_LOAD]], i64 0
329 ; CHECK-NEXT: [[SPLAT_SPLATINSERT16:%.*]] = insertelement <1 x double> poison, double [[TMP10]], i64 0
330 ; CHECK-NEXT: [[SPLAT_SPLAT17:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT16]], <1 x double> poison, <1 x i32> zeroinitializer
331 ; CHECK-NEXT: [[TMP11:%.*]] = fmul <1 x double> [[BLOCK15]], [[SPLAT_SPLAT17]]
332 ; CHECK-NEXT: [[BLOCK18:%.*]] = shufflevector <3 x double> [[COL_LOAD6]], <3 x double> poison, <1 x i32> <i32 2>
333 ; CHECK-NEXT: [[TMP12:%.*]] = extractelement <3 x double> [[COL_LOAD]], i64 1
334 ; CHECK-NEXT: [[SPLAT_SPLATINSERT19:%.*]] = insertelement <1 x double> poison, double [[TMP12]], i64 0
335 ; CHECK-NEXT: [[SPLAT_SPLAT20:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT19]], <1 x double> poison, <1 x i32> zeroinitializer
336 ; CHECK-NEXT: [[TMP13:%.*]] = fmul <1 x double> [[BLOCK18]], [[SPLAT_SPLAT20]]
337 ; CHECK-NEXT: [[TMP14:%.*]] = fadd <1 x double> [[TMP11]], [[TMP13]]
338 ; CHECK-NEXT: [[BLOCK21:%.*]] = shufflevector <3 x double> [[COL_LOAD8]], <3 x double> poison, <1 x i32> <i32 2>
339 ; CHECK-NEXT: [[TMP15:%.*]] = extractelement <3 x double> [[COL_LOAD]], i64 2
340 ; CHECK-NEXT: [[SPLAT_SPLATINSERT22:%.*]] = insertelement <1 x double> poison, double [[TMP15]], i64 0
341 ; CHECK-NEXT: [[SPLAT_SPLAT23:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT22]], <1 x double> poison, <1 x i32> zeroinitializer
342 ; CHECK-NEXT: [[TMP16:%.*]] = fmul <1 x double> [[BLOCK21]], [[SPLAT_SPLAT23]]
343 ; CHECK-NEXT: [[TMP17:%.*]] = fadd <1 x double> [[TMP14]], [[TMP16]]
344 ; CHECK-NEXT: [[TMP18:%.*]] = shufflevector <1 x double> [[TMP17]], <1 x double> poison, <3 x i32> <i32 0, i32 poison, i32 poison>
345 ; CHECK-NEXT: [[TMP19:%.*]] = shufflevector <3 x double> [[TMP9]], <3 x double> [[TMP18]], <3 x i32> <i32 0, i32 1, i32 3>
346 ; CHECK-NEXT: [[BLOCK24:%.*]] = shufflevector <3 x double> [[COL_LOAD4]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
347 ; CHECK-NEXT: [[TMP20:%.*]] = extractelement <3 x double> [[COL_LOAD1]], i64 0
348 ; CHECK-NEXT: [[SPLAT_SPLATINSERT25:%.*]] = insertelement <2 x double> poison, double [[TMP20]], i64 0
349 ; CHECK-NEXT: [[SPLAT_SPLAT26:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT25]], <2 x double> poison, <2 x i32> zeroinitializer
350 ; CHECK-NEXT: [[TMP21:%.*]] = fmul <2 x double> [[BLOCK24]], [[SPLAT_SPLAT26]]
351 ; CHECK-NEXT: [[BLOCK27:%.*]] = shufflevector <3 x double> [[COL_LOAD6]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
352 ; CHECK-NEXT: [[TMP22:%.*]] = extractelement <3 x double> [[COL_LOAD1]], i64 1
353 ; CHECK-NEXT: [[SPLAT_SPLATINSERT28:%.*]] = insertelement <2 x double> poison, double [[TMP22]], i64 0
354 ; CHECK-NEXT: [[SPLAT_SPLAT29:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT28]], <2 x double> poison, <2 x i32> zeroinitializer
355 ; CHECK-NEXT: [[TMP23:%.*]] = fmul <2 x double> [[BLOCK27]], [[SPLAT_SPLAT29]]
356 ; CHECK-NEXT: [[TMP24:%.*]] = fadd <2 x double> [[TMP21]], [[TMP23]]
357 ; CHECK-NEXT: [[BLOCK30:%.*]] = shufflevector <3 x double> [[COL_LOAD8]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
358 ; CHECK-NEXT: [[TMP25:%.*]] = extractelement <3 x double> [[COL_LOAD1]], i64 2
359 ; CHECK-NEXT: [[SPLAT_SPLATINSERT31:%.*]] = insertelement <2 x double> poison, double [[TMP25]], i64 0
360 ; CHECK-NEXT: [[SPLAT_SPLAT32:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT31]], <2 x double> poison, <2 x i32> zeroinitializer
361 ; CHECK-NEXT: [[TMP26:%.*]] = fmul <2 x double> [[BLOCK30]], [[SPLAT_SPLAT32]]
362 ; CHECK-NEXT: [[TMP27:%.*]] = fadd <2 x double> [[TMP24]], [[TMP26]]
363 ; CHECK-NEXT: [[TMP28:%.*]] = shufflevector <2 x double> [[TMP27]], <2 x double> poison, <3 x i32> <i32 0, i32 1, i32 poison>
364 ; CHECK-NEXT: [[TMP29:%.*]] = shufflevector <3 x double> poison, <3 x double> [[TMP28]], <3 x i32> <i32 3, i32 4, i32 2>
365 ; CHECK-NEXT: [[BLOCK33:%.*]] = shufflevector <3 x double> [[COL_LOAD4]], <3 x double> poison, <1 x i32> <i32 2>
366 ; CHECK-NEXT: [[TMP30:%.*]] = extractelement <3 x double> [[COL_LOAD1]], i64 0
367 ; CHECK-NEXT: [[SPLAT_SPLATINSERT34:%.*]] = insertelement <1 x double> poison, double [[TMP30]], i64 0
368 ; CHECK-NEXT: [[SPLAT_SPLAT35:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT34]], <1 x double> poison, <1 x i32> zeroinitializer
369 ; CHECK-NEXT: [[TMP31:%.*]] = fmul <1 x double> [[BLOCK33]], [[SPLAT_SPLAT35]]
370 ; CHECK-NEXT: [[BLOCK36:%.*]] = shufflevector <3 x double> [[COL_LOAD6]], <3 x double> poison, <1 x i32> <i32 2>
371 ; CHECK-NEXT: [[TMP32:%.*]] = extractelement <3 x double> [[COL_LOAD1]], i64 1
372 ; CHECK-NEXT: [[SPLAT_SPLATINSERT37:%.*]] = insertelement <1 x double> poison, double [[TMP32]], i64 0
373 ; CHECK-NEXT: [[SPLAT_SPLAT38:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT37]], <1 x double> poison, <1 x i32> zeroinitializer
374 ; CHECK-NEXT: [[TMP33:%.*]] = fmul <1 x double> [[BLOCK36]], [[SPLAT_SPLAT38]]
375 ; CHECK-NEXT: [[TMP34:%.*]] = fadd <1 x double> [[TMP31]], [[TMP33]]
376 ; CHECK-NEXT: [[BLOCK39:%.*]] = shufflevector <3 x double> [[COL_LOAD8]], <3 x double> poison, <1 x i32> <i32 2>
377 ; CHECK-NEXT: [[TMP35:%.*]] = extractelement <3 x double> [[COL_LOAD1]], i64 2
378 ; CHECK-NEXT: [[SPLAT_SPLATINSERT40:%.*]] = insertelement <1 x double> poison, double [[TMP35]], i64 0
379 ; CHECK-NEXT: [[SPLAT_SPLAT41:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT40]], <1 x double> poison, <1 x i32> zeroinitializer
380 ; CHECK-NEXT: [[TMP36:%.*]] = fmul <1 x double> [[BLOCK39]], [[SPLAT_SPLAT41]]
381 ; CHECK-NEXT: [[TMP37:%.*]] = fadd <1 x double> [[TMP34]], [[TMP36]]
382 ; CHECK-NEXT: [[TMP38:%.*]] = shufflevector <1 x double> [[TMP37]], <1 x double> poison, <3 x i32> <i32 0, i32 poison, i32 poison>
383 ; CHECK-NEXT: [[TMP39:%.*]] = shufflevector <3 x double> [[TMP29]], <3 x double> [[TMP38]], <3 x i32> <i32 0, i32 1, i32 3>
384 ; CHECK-NEXT: [[BLOCK42:%.*]] = shufflevector <3 x double> [[COL_LOAD4]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
385 ; CHECK-NEXT: [[TMP40:%.*]] = extractelement <3 x double> [[COL_LOAD3]], i64 0
386 ; CHECK-NEXT: [[SPLAT_SPLATINSERT43:%.*]] = insertelement <2 x double> poison, double [[TMP40]], i64 0
387 ; CHECK-NEXT: [[SPLAT_SPLAT44:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT43]], <2 x double> poison, <2 x i32> zeroinitializer
388 ; CHECK-NEXT: [[TMP41:%.*]] = fmul <2 x double> [[BLOCK42]], [[SPLAT_SPLAT44]]
389 ; CHECK-NEXT: [[BLOCK45:%.*]] = shufflevector <3 x double> [[COL_LOAD6]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
390 ; CHECK-NEXT: [[TMP42:%.*]] = extractelement <3 x double> [[COL_LOAD3]], i64 1
391 ; CHECK-NEXT: [[SPLAT_SPLATINSERT46:%.*]] = insertelement <2 x double> poison, double [[TMP42]], i64 0
392 ; CHECK-NEXT: [[SPLAT_SPLAT47:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT46]], <2 x double> poison, <2 x i32> zeroinitializer
393 ; CHECK-NEXT: [[TMP43:%.*]] = fmul <2 x double> [[BLOCK45]], [[SPLAT_SPLAT47]]
394 ; CHECK-NEXT: [[TMP44:%.*]] = fadd <2 x double> [[TMP41]], [[TMP43]]
395 ; CHECK-NEXT: [[BLOCK48:%.*]] = shufflevector <3 x double> [[COL_LOAD8]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
396 ; CHECK-NEXT: [[TMP45:%.*]] = extractelement <3 x double> [[COL_LOAD3]], i64 2
397 ; CHECK-NEXT: [[SPLAT_SPLATINSERT49:%.*]] = insertelement <2 x double> poison, double [[TMP45]], i64 0
398 ; CHECK-NEXT: [[SPLAT_SPLAT50:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT49]], <2 x double> poison, <2 x i32> zeroinitializer
399 ; CHECK-NEXT: [[TMP46:%.*]] = fmul <2 x double> [[BLOCK48]], [[SPLAT_SPLAT50]]
400 ; CHECK-NEXT: [[TMP47:%.*]] = fadd <2 x double> [[TMP44]], [[TMP46]]
401 ; CHECK-NEXT: [[TMP48:%.*]] = shufflevector <2 x double> [[TMP47]], <2 x double> poison, <3 x i32> <i32 0, i32 1, i32 poison>
402 ; CHECK-NEXT: [[TMP49:%.*]] = shufflevector <3 x double> poison, <3 x double> [[TMP48]], <3 x i32> <i32 3, i32 4, i32 2>
403 ; CHECK-NEXT: [[BLOCK51:%.*]] = shufflevector <3 x double> [[COL_LOAD4]], <3 x double> poison, <1 x i32> <i32 2>
404 ; CHECK-NEXT: [[TMP50:%.*]] = extractelement <3 x double> [[COL_LOAD3]], i64 0
405 ; CHECK-NEXT: [[SPLAT_SPLATINSERT52:%.*]] = insertelement <1 x double> poison, double [[TMP50]], i64 0
406 ; CHECK-NEXT: [[SPLAT_SPLAT53:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT52]], <1 x double> poison, <1 x i32> zeroinitializer
407 ; CHECK-NEXT: [[TMP51:%.*]] = fmul <1 x double> [[BLOCK51]], [[SPLAT_SPLAT53]]
408 ; CHECK-NEXT: [[BLOCK54:%.*]] = shufflevector <3 x double> [[COL_LOAD6]], <3 x double> poison, <1 x i32> <i32 2>
409 ; CHECK-NEXT: [[TMP52:%.*]] = extractelement <3 x double> [[COL_LOAD3]], i64 1
410 ; CHECK-NEXT: [[SPLAT_SPLATINSERT55:%.*]] = insertelement <1 x double> poison, double [[TMP52]], i64 0
411 ; CHECK-NEXT: [[SPLAT_SPLAT56:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT55]], <1 x double> poison, <1 x i32> zeroinitializer
412 ; CHECK-NEXT: [[TMP53:%.*]] = fmul <1 x double> [[BLOCK54]], [[SPLAT_SPLAT56]]
413 ; CHECK-NEXT: [[TMP54:%.*]] = fadd <1 x double> [[TMP51]], [[TMP53]]
414 ; CHECK-NEXT: [[BLOCK57:%.*]] = shufflevector <3 x double> [[COL_LOAD8]], <3 x double> poison, <1 x i32> <i32 2>
415 ; CHECK-NEXT: [[TMP55:%.*]] = extractelement <3 x double> [[COL_LOAD3]], i64 2
416 ; CHECK-NEXT: [[SPLAT_SPLATINSERT58:%.*]] = insertelement <1 x double> poison, double [[TMP55]], i64 0
417 ; CHECK-NEXT: [[SPLAT_SPLAT59:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT58]], <1 x double> poison, <1 x i32> zeroinitializer
418 ; CHECK-NEXT: [[TMP56:%.*]] = fmul <1 x double> [[BLOCK57]], [[SPLAT_SPLAT59]]
419 ; CHECK-NEXT: [[TMP57:%.*]] = fadd <1 x double> [[TMP54]], [[TMP56]]
420 ; CHECK-NEXT: [[TMP58:%.*]] = shufflevector <1 x double> [[TMP57]], <1 x double> poison, <3 x i32> <i32 0, i32 poison, i32 poison>
421 ; CHECK-NEXT: [[TMP59:%.*]] = shufflevector <3 x double> [[TMP49]], <3 x double> [[TMP58]], <3 x i32> <i32 0, i32 1, i32 3>
422 ; CHECK-NEXT: store <3 x double> [[TMP19]], ptr [[C:%.*]], align 16
423 ; CHECK-NEXT: [[VEC_GEP60:%.*]] = getelementptr double, ptr [[C]], i64 3
424 ; CHECK-NEXT: store <3 x double> [[TMP39]], ptr [[VEC_GEP60]], align 8
425 ; CHECK-NEXT: [[VEC_GEP61:%.*]] = getelementptr double, ptr [[C]], i64 6
426 ; CHECK-NEXT: store <3 x double> [[TMP59]], ptr [[VEC_GEP61]], align 16
427 ; CHECK-NEXT: ret void
430 %a = load <9 x double>, ptr %A, align 16
431 %at = call <9 x double> @llvm.matrix.transpose.v9f64.v9f64(<9 x double> %a, i32 3, i32 3)
432 %b = load <9 x double>, ptr %B, align 16
433 %bt = call <9 x double> @llvm.matrix.transpose.v9f64.v9f64(<9 x double> %b, i32 3, i32 3)
434 %c = call <9 x double> @llvm.matrix.multiply.v9f64.v9f64.v9f64(<9 x double> %at, <9 x double> %bt, i32 3, i32 3, i32 3)
435 %ct = call <9 x double> @llvm.matrix.transpose.v9f64.v9f64(<9 x double> %c, i32 3, i32 3)
436 store <9 x double> %ct, ptr %C, align 16
440 define void @multiply_nt_t(ptr %A, ptr %B, ptr %C) {
441 ; REMARK: Pass: lower-matrix-intrinsics
442 ; REMARK-NEXT: Name: matrix-lowered
443 ; REMARK-NEXT: Function: multiply_nt_t
445 ; REMARK-NEXT: - String: 'Lowered with '
446 ; REMARK-NEXT: - NumStores: '4'
447 ; REMARK-NEXT: - String: ' stores, '
448 ; REMARK-NEXT: - NumLoads: '9'
449 ; REMARK-NEXT: - String: ' loads, '
450 ; REMARK-NEXT: - NumComputeOps: '20'
451 ; REMARK-NEXT: - String: ' compute ops, '
452 ; REMARK-NEXT: - NumExposedTransposes: '0'
453 ; REMARK-NEXT: - String: ' exposed transposes'
454 ; REMARK-NEXT: - String: |
456 ; REMARK-NEXT: multiply.4x3.3x2.double(
457 ; REMARK-NEXT: load(addr %B),
458 ; REMARK-NEXT: transpose.2x3.double(load(addr %A))),
459 ; REMARK-NEXT: addr %C)
460 ; CHECK-LABEL: @multiply_nt_t(
462 ; CHECK-NEXT: [[COL_LOAD:%.*]] = load <2 x double>, ptr [[A:%.*]], align 16
463 ; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr double, ptr [[A]], i64 2
464 ; CHECK-NEXT: [[COL_LOAD39:%.*]] = load <2 x double>, ptr [[VEC_GEP]], align 16
465 ; CHECK-NEXT: [[VEC_GEP40:%.*]] = getelementptr double, ptr [[A]], i64 4
466 ; CHECK-NEXT: [[COL_LOAD41:%.*]] = load <2 x double>, ptr [[VEC_GEP40]], align 16
467 ; CHECK-NEXT: [[TMP0:%.*]] = shufflevector <2 x double> [[COL_LOAD]], <2 x double> [[COL_LOAD39]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
468 ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x double> [[COL_LOAD41]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
469 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x double> [[TMP0]], <4 x double> [[TMP1]], <6 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5>
470 ; CHECK-NEXT: [[COL_LOAD42:%.*]] = load <4 x double>, ptr [[B:%.*]], align 16
471 ; CHECK-NEXT: [[VEC_GEP43:%.*]] = getelementptr double, ptr [[B]], i64 4
472 ; CHECK-NEXT: [[COL_LOAD44:%.*]] = load <4 x double>, ptr [[VEC_GEP43]], align 16
473 ; CHECK-NEXT: [[VEC_GEP45:%.*]] = getelementptr double, ptr [[B]], i64 8
474 ; CHECK-NEXT: [[COL_LOAD46:%.*]] = load <4 x double>, ptr [[VEC_GEP45]], align 16
475 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <4 x double> [[COL_LOAD42]], <4 x double> [[COL_LOAD44]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
476 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <4 x double> [[COL_LOAD46]], <4 x double> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>
477 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <8 x double> [[TMP3]], <8 x double> [[TMP4]], <12 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11>
478 ; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <12 x double> [[TMP5]], <12 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
479 ; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <12 x double> [[TMP5]], <12 x double> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
480 ; CHECK-NEXT: [[SPLIT2:%.*]] = shufflevector <12 x double> [[TMP5]], <12 x double> poison, <4 x i32> <i32 8, i32 9, i32 10, i32 11>
481 ; CHECK-NEXT: [[SPLIT3:%.*]] = shufflevector <6 x double> [[TMP2]], <6 x double> poison, <2 x i32> <i32 0, i32 1>
482 ; CHECK-NEXT: [[SPLIT4:%.*]] = shufflevector <6 x double> [[TMP2]], <6 x double> poison, <2 x i32> <i32 2, i32 3>
483 ; CHECK-NEXT: [[SPLIT5:%.*]] = shufflevector <6 x double> [[TMP2]], <6 x double> poison, <2 x i32> <i32 4, i32 5>
484 ; CHECK-NEXT: [[BLOCK:%.*]] = shufflevector <4 x double> [[SPLIT]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
485 ; CHECK-NEXT: [[TMP6:%.*]] = extractelement <2 x double> [[SPLIT3]], i64 0
486 ; CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <2 x double> poison, double [[TMP6]], i64 0
487 ; CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT]], <2 x double> poison, <2 x i32> zeroinitializer
488 ; CHECK-NEXT: [[TMP7:%.*]] = fmul <2 x double> [[BLOCK]], [[SPLAT_SPLAT]]
489 ; CHECK-NEXT: [[BLOCK6:%.*]] = shufflevector <4 x double> [[SPLIT1]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
490 ; CHECK-NEXT: [[TMP8:%.*]] = extractelement <2 x double> [[SPLIT4]], i64 0
491 ; CHECK-NEXT: [[SPLAT_SPLATINSERT7:%.*]] = insertelement <2 x double> poison, double [[TMP8]], i64 0
492 ; CHECK-NEXT: [[SPLAT_SPLAT8:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT7]], <2 x double> poison, <2 x i32> zeroinitializer
493 ; CHECK-NEXT: [[TMP9:%.*]] = fmul <2 x double> [[BLOCK6]], [[SPLAT_SPLAT8]]
494 ; CHECK-NEXT: [[TMP10:%.*]] = fadd <2 x double> [[TMP7]], [[TMP9]]
495 ; CHECK-NEXT: [[BLOCK9:%.*]] = shufflevector <4 x double> [[SPLIT2]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
496 ; CHECK-NEXT: [[TMP11:%.*]] = extractelement <2 x double> [[SPLIT5]], i64 0
497 ; CHECK-NEXT: [[SPLAT_SPLATINSERT10:%.*]] = insertelement <2 x double> poison, double [[TMP11]], i64 0
498 ; CHECK-NEXT: [[SPLAT_SPLAT11:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT10]], <2 x double> poison, <2 x i32> zeroinitializer
499 ; CHECK-NEXT: [[TMP12:%.*]] = fmul <2 x double> [[BLOCK9]], [[SPLAT_SPLAT11]]
500 ; CHECK-NEXT: [[TMP13:%.*]] = fadd <2 x double> [[TMP10]], [[TMP12]]
501 ; CHECK-NEXT: [[TMP14:%.*]] = shufflevector <2 x double> [[TMP13]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
502 ; CHECK-NEXT: [[TMP15:%.*]] = shufflevector <4 x double> poison, <4 x double> [[TMP14]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
503 ; CHECK-NEXT: [[BLOCK12:%.*]] = shufflevector <4 x double> [[SPLIT]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
504 ; CHECK-NEXT: [[TMP16:%.*]] = extractelement <2 x double> [[SPLIT3]], i64 0
505 ; CHECK-NEXT: [[SPLAT_SPLATINSERT13:%.*]] = insertelement <2 x double> poison, double [[TMP16]], i64 0
506 ; CHECK-NEXT: [[SPLAT_SPLAT14:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT13]], <2 x double> poison, <2 x i32> zeroinitializer
507 ; CHECK-NEXT: [[TMP17:%.*]] = fmul <2 x double> [[BLOCK12]], [[SPLAT_SPLAT14]]
508 ; CHECK-NEXT: [[BLOCK15:%.*]] = shufflevector <4 x double> [[SPLIT1]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
509 ; CHECK-NEXT: [[TMP18:%.*]] = extractelement <2 x double> [[SPLIT4]], i64 0
510 ; CHECK-NEXT: [[SPLAT_SPLATINSERT16:%.*]] = insertelement <2 x double> poison, double [[TMP18]], i64 0
511 ; CHECK-NEXT: [[SPLAT_SPLAT17:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT16]], <2 x double> poison, <2 x i32> zeroinitializer
512 ; CHECK-NEXT: [[TMP19:%.*]] = fmul <2 x double> [[BLOCK15]], [[SPLAT_SPLAT17]]
513 ; CHECK-NEXT: [[TMP20:%.*]] = fadd <2 x double> [[TMP17]], [[TMP19]]
514 ; CHECK-NEXT: [[BLOCK18:%.*]] = shufflevector <4 x double> [[SPLIT2]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
515 ; CHECK-NEXT: [[TMP21:%.*]] = extractelement <2 x double> [[SPLIT5]], i64 0
516 ; CHECK-NEXT: [[SPLAT_SPLATINSERT19:%.*]] = insertelement <2 x double> poison, double [[TMP21]], i64 0
517 ; CHECK-NEXT: [[SPLAT_SPLAT20:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT19]], <2 x double> poison, <2 x i32> zeroinitializer
518 ; CHECK-NEXT: [[TMP22:%.*]] = fmul <2 x double> [[BLOCK18]], [[SPLAT_SPLAT20]]
519 ; CHECK-NEXT: [[TMP23:%.*]] = fadd <2 x double> [[TMP20]], [[TMP22]]
520 ; CHECK-NEXT: [[TMP24:%.*]] = shufflevector <2 x double> [[TMP23]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
521 ; CHECK-NEXT: [[TMP25:%.*]] = shufflevector <4 x double> [[TMP15]], <4 x double> [[TMP24]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
522 ; CHECK-NEXT: [[BLOCK21:%.*]] = shufflevector <4 x double> [[SPLIT]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
523 ; CHECK-NEXT: [[TMP26:%.*]] = extractelement <2 x double> [[SPLIT3]], i64 1
524 ; CHECK-NEXT: [[SPLAT_SPLATINSERT22:%.*]] = insertelement <2 x double> poison, double [[TMP26]], i64 0
525 ; CHECK-NEXT: [[SPLAT_SPLAT23:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT22]], <2 x double> poison, <2 x i32> zeroinitializer
526 ; CHECK-NEXT: [[TMP27:%.*]] = fmul <2 x double> [[BLOCK21]], [[SPLAT_SPLAT23]]
527 ; CHECK-NEXT: [[BLOCK24:%.*]] = shufflevector <4 x double> [[SPLIT1]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
528 ; CHECK-NEXT: [[TMP28:%.*]] = extractelement <2 x double> [[SPLIT4]], i64 1
529 ; CHECK-NEXT: [[SPLAT_SPLATINSERT25:%.*]] = insertelement <2 x double> poison, double [[TMP28]], i64 0
530 ; CHECK-NEXT: [[SPLAT_SPLAT26:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT25]], <2 x double> poison, <2 x i32> zeroinitializer
531 ; CHECK-NEXT: [[TMP29:%.*]] = fmul <2 x double> [[BLOCK24]], [[SPLAT_SPLAT26]]
532 ; CHECK-NEXT: [[TMP30:%.*]] = fadd <2 x double> [[TMP27]], [[TMP29]]
533 ; CHECK-NEXT: [[BLOCK27:%.*]] = shufflevector <4 x double> [[SPLIT2]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
534 ; CHECK-NEXT: [[TMP31:%.*]] = extractelement <2 x double> [[SPLIT5]], i64 1
535 ; CHECK-NEXT: [[SPLAT_SPLATINSERT28:%.*]] = insertelement <2 x double> poison, double [[TMP31]], i64 0
536 ; CHECK-NEXT: [[SPLAT_SPLAT29:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT28]], <2 x double> poison, <2 x i32> zeroinitializer
537 ; CHECK-NEXT: [[TMP32:%.*]] = fmul <2 x double> [[BLOCK27]], [[SPLAT_SPLAT29]]
538 ; CHECK-NEXT: [[TMP33:%.*]] = fadd <2 x double> [[TMP30]], [[TMP32]]
539 ; CHECK-NEXT: [[TMP34:%.*]] = shufflevector <2 x double> [[TMP33]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
540 ; CHECK-NEXT: [[TMP35:%.*]] = shufflevector <4 x double> poison, <4 x double> [[TMP34]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
541 ; CHECK-NEXT: [[BLOCK30:%.*]] = shufflevector <4 x double> [[SPLIT]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
542 ; CHECK-NEXT: [[TMP36:%.*]] = extractelement <2 x double> [[SPLIT3]], i64 1
543 ; CHECK-NEXT: [[SPLAT_SPLATINSERT31:%.*]] = insertelement <2 x double> poison, double [[TMP36]], i64 0
544 ; CHECK-NEXT: [[SPLAT_SPLAT32:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT31]], <2 x double> poison, <2 x i32> zeroinitializer
545 ; CHECK-NEXT: [[TMP37:%.*]] = fmul <2 x double> [[BLOCK30]], [[SPLAT_SPLAT32]]
546 ; CHECK-NEXT: [[BLOCK33:%.*]] = shufflevector <4 x double> [[SPLIT1]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
547 ; CHECK-NEXT: [[TMP38:%.*]] = extractelement <2 x double> [[SPLIT4]], i64 1
548 ; CHECK-NEXT: [[SPLAT_SPLATINSERT34:%.*]] = insertelement <2 x double> poison, double [[TMP38]], i64 0
549 ; CHECK-NEXT: [[SPLAT_SPLAT35:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT34]], <2 x double> poison, <2 x i32> zeroinitializer
550 ; CHECK-NEXT: [[TMP39:%.*]] = fmul <2 x double> [[BLOCK33]], [[SPLAT_SPLAT35]]
551 ; CHECK-NEXT: [[TMP40:%.*]] = fadd <2 x double> [[TMP37]], [[TMP39]]
552 ; CHECK-NEXT: [[BLOCK36:%.*]] = shufflevector <4 x double> [[SPLIT2]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
553 ; CHECK-NEXT: [[TMP41:%.*]] = extractelement <2 x double> [[SPLIT5]], i64 1
554 ; CHECK-NEXT: [[SPLAT_SPLATINSERT37:%.*]] = insertelement <2 x double> poison, double [[TMP41]], i64 0
555 ; CHECK-NEXT: [[SPLAT_SPLAT38:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT37]], <2 x double> poison, <2 x i32> zeroinitializer
556 ; CHECK-NEXT: [[TMP42:%.*]] = fmul <2 x double> [[BLOCK36]], [[SPLAT_SPLAT38]]
557 ; CHECK-NEXT: [[TMP43:%.*]] = fadd <2 x double> [[TMP40]], [[TMP42]]
558 ; CHECK-NEXT: [[TMP44:%.*]] = shufflevector <2 x double> [[TMP43]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
559 ; CHECK-NEXT: [[TMP45:%.*]] = shufflevector <4 x double> [[TMP35]], <4 x double> [[TMP44]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
560 ; CHECK-NEXT: store <4 x double> [[TMP25]], ptr [[C:%.*]], align 16
561 ; CHECK-NEXT: [[VEC_GEP47:%.*]] = getelementptr double, ptr [[C]], i64 4
562 ; CHECK-NEXT: store <4 x double> [[TMP45]], ptr [[VEC_GEP47]], align 16
563 ; CHECK-NEXT: ret void
566 %a = load <6 x double>, ptr %A, align 16
567 %b = load <12 x double>, ptr %B, align 16
568 %bt = call <12 x double> @llvm.matrix.transpose.v12f64.v12f64(<12 x double> %b, i32 4, i32 3)
569 %c = call <8 x double> @llvm.matrix.multiply.v8f64.v6f64.v12f64(<6 x double> %a, <12 x double> %bt, i32 2, i32 3, i32 4)
570 %ct = call <8 x double> @llvm.matrix.transpose.v8f64.v8f64(<8 x double> %c, i32 2, i32 4)
571 store <8 x double> %ct, ptr %C, align 16
575 define void @multiply_ntt_t(ptr %A, ptr %B, ptr %C, ptr %R) {
576 ; REMARK: Pass: lower-matrix-intrinsics
577 ; REMARK-NEXT: Name: matrix-lowered
578 ; REMARK-NEXT: Function: multiply_ntt_t
580 ; REMARK-NEXT: - String: 'Lowered with '
581 ; REMARK-NEXT: - NumStores: '6'
582 ; REMARK-NEXT: - String: ' stores, '
583 ; REMARK-NEXT: - NumLoads: '18'
584 ; REMARK-NEXT: - String: ' loads, '
585 ; REMARK-NEXT: - NumComputeOps: '60'
586 ; REMARK-NEXT: - String: ' compute ops, '
587 ; REMARK-NEXT: - NumExposedTransposes: '0'
588 ; REMARK-NEXT: - String: ' exposed transposes'
589 ; REMARK-NEXT: - String: |
591 ; REMARK-NEXT: multiply.3x3.3x3.double(
592 ; REMARK-NEXT: multiply.3x3.3x3.double(
593 ; REMARK-NEXT: load(addr %C),
594 ; REMARK-NEXT: load(addr %B)),
595 ; REMARK-NEXT: transpose.3x3.double(load(addr %A))),
596 ; REMARK-NEXT: addr %R)
597 ; CHECK-LABEL: @multiply_ntt_t(
599 ; CHECK-NEXT: [[COL_LOAD:%.*]] = load <3 x double>, ptr [[A:%.*]], align 16
600 ; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr double, ptr [[A]], i64 3
601 ; CHECK-NEXT: [[COL_LOAD58:%.*]] = load <3 x double>, ptr [[VEC_GEP]], align 8
602 ; CHECK-NEXT: [[VEC_GEP59:%.*]] = getelementptr double, ptr [[A]], i64 6
603 ; CHECK-NEXT: [[COL_LOAD60:%.*]] = load <3 x double>, ptr [[VEC_GEP59]], align 16
604 ; CHECK-NEXT: [[TMP0:%.*]] = shufflevector <3 x double> [[COL_LOAD]], <3 x double> [[COL_LOAD58]], <6 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5>
605 ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <3 x double> [[COL_LOAD60]], <3 x double> poison, <6 x i32> <i32 0, i32 1, i32 2, i32 poison, i32 poison, i32 poison>
606 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <6 x double> [[TMP0]], <6 x double> [[TMP1]], <9 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8>
607 ; CHECK-NEXT: [[COL_LOAD61:%.*]] = load <3 x double>, ptr [[B:%.*]], align 16
608 ; CHECK-NEXT: [[VEC_GEP62:%.*]] = getelementptr double, ptr [[B]], i64 3
609 ; CHECK-NEXT: [[COL_LOAD63:%.*]] = load <3 x double>, ptr [[VEC_GEP62]], align 8
610 ; CHECK-NEXT: [[VEC_GEP64:%.*]] = getelementptr double, ptr [[B]], i64 6
611 ; CHECK-NEXT: [[COL_LOAD65:%.*]] = load <3 x double>, ptr [[VEC_GEP64]], align 16
612 ; CHECK-NEXT: [[COL_LOAD66:%.*]] = load <3 x double>, ptr [[C:%.*]], align 16
613 ; CHECK-NEXT: [[VEC_GEP67:%.*]] = getelementptr double, ptr [[C]], i64 3
614 ; CHECK-NEXT: [[COL_LOAD68:%.*]] = load <3 x double>, ptr [[VEC_GEP67]], align 8
615 ; CHECK-NEXT: [[VEC_GEP69:%.*]] = getelementptr double, ptr [[C]], i64 6
616 ; CHECK-NEXT: [[COL_LOAD70:%.*]] = load <3 x double>, ptr [[VEC_GEP69]], align 16
617 ; CHECK-NEXT: [[BLOCK71:%.*]] = shufflevector <3 x double> [[COL_LOAD66]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
618 ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <3 x double> [[COL_LOAD61]], i64 0
619 ; CHECK-NEXT: [[SPLAT_SPLATINSERT72:%.*]] = insertelement <2 x double> poison, double [[TMP3]], i64 0
620 ; CHECK-NEXT: [[SPLAT_SPLAT73:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT72]], <2 x double> poison, <2 x i32> zeroinitializer
621 ; CHECK-NEXT: [[TMP4:%.*]] = fmul <2 x double> [[BLOCK71]], [[SPLAT_SPLAT73]]
622 ; CHECK-NEXT: [[BLOCK74:%.*]] = shufflevector <3 x double> [[COL_LOAD68]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
623 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <3 x double> [[COL_LOAD61]], i64 1
624 ; CHECK-NEXT: [[SPLAT_SPLATINSERT75:%.*]] = insertelement <2 x double> poison, double [[TMP5]], i64 0
625 ; CHECK-NEXT: [[SPLAT_SPLAT76:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT75]], <2 x double> poison, <2 x i32> zeroinitializer
626 ; CHECK-NEXT: [[TMP6:%.*]] = fmul <2 x double> [[BLOCK74]], [[SPLAT_SPLAT76]]
627 ; CHECK-NEXT: [[TMP7:%.*]] = fadd <2 x double> [[TMP4]], [[TMP6]]
628 ; CHECK-NEXT: [[BLOCK77:%.*]] = shufflevector <3 x double> [[COL_LOAD70]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
629 ; CHECK-NEXT: [[TMP8:%.*]] = extractelement <3 x double> [[COL_LOAD61]], i64 2
630 ; CHECK-NEXT: [[SPLAT_SPLATINSERT78:%.*]] = insertelement <2 x double> poison, double [[TMP8]], i64 0
631 ; CHECK-NEXT: [[SPLAT_SPLAT79:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT78]], <2 x double> poison, <2 x i32> zeroinitializer
632 ; CHECK-NEXT: [[TMP9:%.*]] = fmul <2 x double> [[BLOCK77]], [[SPLAT_SPLAT79]]
633 ; CHECK-NEXT: [[TMP10:%.*]] = fadd <2 x double> [[TMP7]], [[TMP9]]
634 ; CHECK-NEXT: [[TMP11:%.*]] = shufflevector <2 x double> [[TMP10]], <2 x double> poison, <3 x i32> <i32 0, i32 1, i32 poison>
635 ; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <3 x double> poison, <3 x double> [[TMP11]], <3 x i32> <i32 3, i32 4, i32 2>
636 ; CHECK-NEXT: [[BLOCK80:%.*]] = shufflevector <3 x double> [[COL_LOAD66]], <3 x double> poison, <1 x i32> <i32 2>
637 ; CHECK-NEXT: [[TMP13:%.*]] = extractelement <3 x double> [[COL_LOAD61]], i64 0
638 ; CHECK-NEXT: [[SPLAT_SPLATINSERT81:%.*]] = insertelement <1 x double> poison, double [[TMP13]], i64 0
639 ; CHECK-NEXT: [[SPLAT_SPLAT82:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT81]], <1 x double> poison, <1 x i32> zeroinitializer
640 ; CHECK-NEXT: [[TMP14:%.*]] = fmul <1 x double> [[BLOCK80]], [[SPLAT_SPLAT82]]
641 ; CHECK-NEXT: [[BLOCK83:%.*]] = shufflevector <3 x double> [[COL_LOAD68]], <3 x double> poison, <1 x i32> <i32 2>
642 ; CHECK-NEXT: [[TMP15:%.*]] = extractelement <3 x double> [[COL_LOAD61]], i64 1
643 ; CHECK-NEXT: [[SPLAT_SPLATINSERT84:%.*]] = insertelement <1 x double> poison, double [[TMP15]], i64 0
644 ; CHECK-NEXT: [[SPLAT_SPLAT85:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT84]], <1 x double> poison, <1 x i32> zeroinitializer
645 ; CHECK-NEXT: [[TMP16:%.*]] = fmul <1 x double> [[BLOCK83]], [[SPLAT_SPLAT85]]
646 ; CHECK-NEXT: [[TMP17:%.*]] = fadd <1 x double> [[TMP14]], [[TMP16]]
647 ; CHECK-NEXT: [[BLOCK86:%.*]] = shufflevector <3 x double> [[COL_LOAD70]], <3 x double> poison, <1 x i32> <i32 2>
648 ; CHECK-NEXT: [[TMP18:%.*]] = extractelement <3 x double> [[COL_LOAD61]], i64 2
649 ; CHECK-NEXT: [[SPLAT_SPLATINSERT87:%.*]] = insertelement <1 x double> poison, double [[TMP18]], i64 0
650 ; CHECK-NEXT: [[SPLAT_SPLAT88:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT87]], <1 x double> poison, <1 x i32> zeroinitializer
651 ; CHECK-NEXT: [[TMP19:%.*]] = fmul <1 x double> [[BLOCK86]], [[SPLAT_SPLAT88]]
652 ; CHECK-NEXT: [[TMP20:%.*]] = fadd <1 x double> [[TMP17]], [[TMP19]]
653 ; CHECK-NEXT: [[TMP21:%.*]] = shufflevector <1 x double> [[TMP20]], <1 x double> poison, <3 x i32> <i32 0, i32 poison, i32 poison>
654 ; CHECK-NEXT: [[TMP22:%.*]] = shufflevector <3 x double> [[TMP12]], <3 x double> [[TMP21]], <3 x i32> <i32 0, i32 1, i32 3>
655 ; CHECK-NEXT: [[BLOCK89:%.*]] = shufflevector <3 x double> [[COL_LOAD66]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
656 ; CHECK-NEXT: [[TMP23:%.*]] = extractelement <3 x double> [[COL_LOAD63]], i64 0
657 ; CHECK-NEXT: [[SPLAT_SPLATINSERT90:%.*]] = insertelement <2 x double> poison, double [[TMP23]], i64 0
658 ; CHECK-NEXT: [[SPLAT_SPLAT91:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT90]], <2 x double> poison, <2 x i32> zeroinitializer
659 ; CHECK-NEXT: [[TMP24:%.*]] = fmul <2 x double> [[BLOCK89]], [[SPLAT_SPLAT91]]
660 ; CHECK-NEXT: [[BLOCK92:%.*]] = shufflevector <3 x double> [[COL_LOAD68]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
661 ; CHECK-NEXT: [[TMP25:%.*]] = extractelement <3 x double> [[COL_LOAD63]], i64 1
662 ; CHECK-NEXT: [[SPLAT_SPLATINSERT93:%.*]] = insertelement <2 x double> poison, double [[TMP25]], i64 0
663 ; CHECK-NEXT: [[SPLAT_SPLAT94:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT93]], <2 x double> poison, <2 x i32> zeroinitializer
664 ; CHECK-NEXT: [[TMP26:%.*]] = fmul <2 x double> [[BLOCK92]], [[SPLAT_SPLAT94]]
665 ; CHECK-NEXT: [[TMP27:%.*]] = fadd <2 x double> [[TMP24]], [[TMP26]]
666 ; CHECK-NEXT: [[BLOCK95:%.*]] = shufflevector <3 x double> [[COL_LOAD70]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
667 ; CHECK-NEXT: [[TMP28:%.*]] = extractelement <3 x double> [[COL_LOAD63]], i64 2
668 ; CHECK-NEXT: [[SPLAT_SPLATINSERT96:%.*]] = insertelement <2 x double> poison, double [[TMP28]], i64 0
669 ; CHECK-NEXT: [[SPLAT_SPLAT97:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT96]], <2 x double> poison, <2 x i32> zeroinitializer
670 ; CHECK-NEXT: [[TMP29:%.*]] = fmul <2 x double> [[BLOCK95]], [[SPLAT_SPLAT97]]
671 ; CHECK-NEXT: [[TMP30:%.*]] = fadd <2 x double> [[TMP27]], [[TMP29]]
672 ; CHECK-NEXT: [[TMP31:%.*]] = shufflevector <2 x double> [[TMP30]], <2 x double> poison, <3 x i32> <i32 0, i32 1, i32 poison>
673 ; CHECK-NEXT: [[TMP32:%.*]] = shufflevector <3 x double> poison, <3 x double> [[TMP31]], <3 x i32> <i32 3, i32 4, i32 2>
674 ; CHECK-NEXT: [[BLOCK98:%.*]] = shufflevector <3 x double> [[COL_LOAD66]], <3 x double> poison, <1 x i32> <i32 2>
675 ; CHECK-NEXT: [[TMP33:%.*]] = extractelement <3 x double> [[COL_LOAD63]], i64 0
676 ; CHECK-NEXT: [[SPLAT_SPLATINSERT99:%.*]] = insertelement <1 x double> poison, double [[TMP33]], i64 0
677 ; CHECK-NEXT: [[SPLAT_SPLAT100:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT99]], <1 x double> poison, <1 x i32> zeroinitializer
678 ; CHECK-NEXT: [[TMP34:%.*]] = fmul <1 x double> [[BLOCK98]], [[SPLAT_SPLAT100]]
679 ; CHECK-NEXT: [[BLOCK101:%.*]] = shufflevector <3 x double> [[COL_LOAD68]], <3 x double> poison, <1 x i32> <i32 2>
680 ; CHECK-NEXT: [[TMP35:%.*]] = extractelement <3 x double> [[COL_LOAD63]], i64 1
681 ; CHECK-NEXT: [[SPLAT_SPLATINSERT102:%.*]] = insertelement <1 x double> poison, double [[TMP35]], i64 0
682 ; CHECK-NEXT: [[SPLAT_SPLAT103:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT102]], <1 x double> poison, <1 x i32> zeroinitializer
683 ; CHECK-NEXT: [[TMP36:%.*]] = fmul <1 x double> [[BLOCK101]], [[SPLAT_SPLAT103]]
684 ; CHECK-NEXT: [[TMP37:%.*]] = fadd <1 x double> [[TMP34]], [[TMP36]]
685 ; CHECK-NEXT: [[BLOCK104:%.*]] = shufflevector <3 x double> [[COL_LOAD70]], <3 x double> poison, <1 x i32> <i32 2>
686 ; CHECK-NEXT: [[TMP38:%.*]] = extractelement <3 x double> [[COL_LOAD63]], i64 2
687 ; CHECK-NEXT: [[SPLAT_SPLATINSERT105:%.*]] = insertelement <1 x double> poison, double [[TMP38]], i64 0
688 ; CHECK-NEXT: [[SPLAT_SPLAT106:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT105]], <1 x double> poison, <1 x i32> zeroinitializer
689 ; CHECK-NEXT: [[TMP39:%.*]] = fmul <1 x double> [[BLOCK104]], [[SPLAT_SPLAT106]]
690 ; CHECK-NEXT: [[TMP40:%.*]] = fadd <1 x double> [[TMP37]], [[TMP39]]
691 ; CHECK-NEXT: [[TMP41:%.*]] = shufflevector <1 x double> [[TMP40]], <1 x double> poison, <3 x i32> <i32 0, i32 poison, i32 poison>
692 ; CHECK-NEXT: [[TMP42:%.*]] = shufflevector <3 x double> [[TMP32]], <3 x double> [[TMP41]], <3 x i32> <i32 0, i32 1, i32 3>
693 ; CHECK-NEXT: [[BLOCK107:%.*]] = shufflevector <3 x double> [[COL_LOAD66]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
694 ; CHECK-NEXT: [[TMP43:%.*]] = extractelement <3 x double> [[COL_LOAD65]], i64 0
695 ; CHECK-NEXT: [[SPLAT_SPLATINSERT108:%.*]] = insertelement <2 x double> poison, double [[TMP43]], i64 0
696 ; CHECK-NEXT: [[SPLAT_SPLAT109:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT108]], <2 x double> poison, <2 x i32> zeroinitializer
697 ; CHECK-NEXT: [[TMP44:%.*]] = fmul <2 x double> [[BLOCK107]], [[SPLAT_SPLAT109]]
698 ; CHECK-NEXT: [[BLOCK110:%.*]] = shufflevector <3 x double> [[COL_LOAD68]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
699 ; CHECK-NEXT: [[TMP45:%.*]] = extractelement <3 x double> [[COL_LOAD65]], i64 1
700 ; CHECK-NEXT: [[SPLAT_SPLATINSERT111:%.*]] = insertelement <2 x double> poison, double [[TMP45]], i64 0
701 ; CHECK-NEXT: [[SPLAT_SPLAT112:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT111]], <2 x double> poison, <2 x i32> zeroinitializer
702 ; CHECK-NEXT: [[TMP46:%.*]] = fmul <2 x double> [[BLOCK110]], [[SPLAT_SPLAT112]]
703 ; CHECK-NEXT: [[TMP47:%.*]] = fadd <2 x double> [[TMP44]], [[TMP46]]
704 ; CHECK-NEXT: [[BLOCK113:%.*]] = shufflevector <3 x double> [[COL_LOAD70]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
705 ; CHECK-NEXT: [[TMP48:%.*]] = extractelement <3 x double> [[COL_LOAD65]], i64 2
706 ; CHECK-NEXT: [[SPLAT_SPLATINSERT114:%.*]] = insertelement <2 x double> poison, double [[TMP48]], i64 0
707 ; CHECK-NEXT: [[SPLAT_SPLAT115:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT114]], <2 x double> poison, <2 x i32> zeroinitializer
708 ; CHECK-NEXT: [[TMP49:%.*]] = fmul <2 x double> [[BLOCK113]], [[SPLAT_SPLAT115]]
709 ; CHECK-NEXT: [[TMP50:%.*]] = fadd <2 x double> [[TMP47]], [[TMP49]]
710 ; CHECK-NEXT: [[TMP51:%.*]] = shufflevector <2 x double> [[TMP50]], <2 x double> poison, <3 x i32> <i32 0, i32 1, i32 poison>
711 ; CHECK-NEXT: [[TMP52:%.*]] = shufflevector <3 x double> poison, <3 x double> [[TMP51]], <3 x i32> <i32 3, i32 4, i32 2>
712 ; CHECK-NEXT: [[BLOCK116:%.*]] = shufflevector <3 x double> [[COL_LOAD66]], <3 x double> poison, <1 x i32> <i32 2>
713 ; CHECK-NEXT: [[TMP53:%.*]] = extractelement <3 x double> [[COL_LOAD65]], i64 0
714 ; CHECK-NEXT: [[SPLAT_SPLATINSERT117:%.*]] = insertelement <1 x double> poison, double [[TMP53]], i64 0
715 ; CHECK-NEXT: [[SPLAT_SPLAT118:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT117]], <1 x double> poison, <1 x i32> zeroinitializer
716 ; CHECK-NEXT: [[TMP54:%.*]] = fmul <1 x double> [[BLOCK116]], [[SPLAT_SPLAT118]]
717 ; CHECK-NEXT: [[BLOCK119:%.*]] = shufflevector <3 x double> [[COL_LOAD68]], <3 x double> poison, <1 x i32> <i32 2>
718 ; CHECK-NEXT: [[TMP55:%.*]] = extractelement <3 x double> [[COL_LOAD65]], i64 1
719 ; CHECK-NEXT: [[SPLAT_SPLATINSERT120:%.*]] = insertelement <1 x double> poison, double [[TMP55]], i64 0
720 ; CHECK-NEXT: [[SPLAT_SPLAT121:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT120]], <1 x double> poison, <1 x i32> zeroinitializer
721 ; CHECK-NEXT: [[TMP56:%.*]] = fmul <1 x double> [[BLOCK119]], [[SPLAT_SPLAT121]]
722 ; CHECK-NEXT: [[TMP57:%.*]] = fadd <1 x double> [[TMP54]], [[TMP56]]
723 ; CHECK-NEXT: [[BLOCK122:%.*]] = shufflevector <3 x double> [[COL_LOAD70]], <3 x double> poison, <1 x i32> <i32 2>
724 ; CHECK-NEXT: [[TMP58:%.*]] = extractelement <3 x double> [[COL_LOAD65]], i64 2
725 ; CHECK-NEXT: [[SPLAT_SPLATINSERT123:%.*]] = insertelement <1 x double> poison, double [[TMP58]], i64 0
726 ; CHECK-NEXT: [[SPLAT_SPLAT124:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT123]], <1 x double> poison, <1 x i32> zeroinitializer
727 ; CHECK-NEXT: [[TMP59:%.*]] = fmul <1 x double> [[BLOCK122]], [[SPLAT_SPLAT124]]
728 ; CHECK-NEXT: [[TMP60:%.*]] = fadd <1 x double> [[TMP57]], [[TMP59]]
729 ; CHECK-NEXT: [[TMP61:%.*]] = shufflevector <1 x double> [[TMP60]], <1 x double> poison, <3 x i32> <i32 0, i32 poison, i32 poison>
730 ; CHECK-NEXT: [[TMP62:%.*]] = shufflevector <3 x double> [[TMP52]], <3 x double> [[TMP61]], <3 x i32> <i32 0, i32 1, i32 3>
731 ; CHECK-NEXT: [[TMP63:%.*]] = shufflevector <3 x double> [[TMP22]], <3 x double> [[TMP42]], <6 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5>
732 ; CHECK-NEXT: [[TMP64:%.*]] = shufflevector <3 x double> [[TMP62]], <3 x double> poison, <6 x i32> <i32 0, i32 1, i32 2, i32 poison, i32 poison, i32 poison>
733 ; CHECK-NEXT: [[TMP65:%.*]] = shufflevector <6 x double> [[TMP63]], <6 x double> [[TMP64]], <9 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8>
734 ; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <9 x double> [[TMP65]], <9 x double> poison, <3 x i32> <i32 0, i32 1, i32 2>
735 ; CHECK-NEXT: [[SPLIT2:%.*]] = shufflevector <9 x double> [[TMP65]], <9 x double> poison, <3 x i32> <i32 3, i32 4, i32 5>
736 ; CHECK-NEXT: [[SPLIT3:%.*]] = shufflevector <9 x double> [[TMP65]], <9 x double> poison, <3 x i32> <i32 6, i32 7, i32 8>
737 ; CHECK-NEXT: [[SPLIT4:%.*]] = shufflevector <9 x double> [[TMP2]], <9 x double> poison, <3 x i32> <i32 0, i32 1, i32 2>
738 ; CHECK-NEXT: [[SPLIT5:%.*]] = shufflevector <9 x double> [[TMP2]], <9 x double> poison, <3 x i32> <i32 3, i32 4, i32 5>
739 ; CHECK-NEXT: [[SPLIT6:%.*]] = shufflevector <9 x double> [[TMP2]], <9 x double> poison, <3 x i32> <i32 6, i32 7, i32 8>
740 ; CHECK-NEXT: [[BLOCK:%.*]] = shufflevector <3 x double> [[SPLIT]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
741 ; CHECK-NEXT: [[TMP66:%.*]] = extractelement <3 x double> [[SPLIT4]], i64 0
742 ; CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <2 x double> poison, double [[TMP66]], i64 0
743 ; CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT]], <2 x double> poison, <2 x i32> zeroinitializer
744 ; CHECK-NEXT: [[TMP67:%.*]] = fmul <2 x double> [[BLOCK]], [[SPLAT_SPLAT]]
745 ; CHECK-NEXT: [[BLOCK7:%.*]] = shufflevector <3 x double> [[SPLIT2]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
746 ; CHECK-NEXT: [[TMP68:%.*]] = extractelement <3 x double> [[SPLIT5]], i64 0
747 ; CHECK-NEXT: [[SPLAT_SPLATINSERT8:%.*]] = insertelement <2 x double> poison, double [[TMP68]], i64 0
748 ; CHECK-NEXT: [[SPLAT_SPLAT9:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT8]], <2 x double> poison, <2 x i32> zeroinitializer
749 ; CHECK-NEXT: [[TMP69:%.*]] = fmul <2 x double> [[BLOCK7]], [[SPLAT_SPLAT9]]
750 ; CHECK-NEXT: [[TMP70:%.*]] = fadd <2 x double> [[TMP67]], [[TMP69]]
751 ; CHECK-NEXT: [[BLOCK10:%.*]] = shufflevector <3 x double> [[SPLIT3]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
752 ; CHECK-NEXT: [[TMP71:%.*]] = extractelement <3 x double> [[SPLIT6]], i64 0
753 ; CHECK-NEXT: [[SPLAT_SPLATINSERT11:%.*]] = insertelement <2 x double> poison, double [[TMP71]], i64 0
754 ; CHECK-NEXT: [[SPLAT_SPLAT12:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT11]], <2 x double> poison, <2 x i32> zeroinitializer
755 ; CHECK-NEXT: [[TMP72:%.*]] = fmul <2 x double> [[BLOCK10]], [[SPLAT_SPLAT12]]
756 ; CHECK-NEXT: [[TMP73:%.*]] = fadd <2 x double> [[TMP70]], [[TMP72]]
757 ; CHECK-NEXT: [[TMP74:%.*]] = shufflevector <2 x double> [[TMP73]], <2 x double> poison, <3 x i32> <i32 0, i32 1, i32 poison>
758 ; CHECK-NEXT: [[TMP75:%.*]] = shufflevector <3 x double> poison, <3 x double> [[TMP74]], <3 x i32> <i32 3, i32 4, i32 2>
759 ; CHECK-NEXT: [[BLOCK13:%.*]] = shufflevector <3 x double> [[SPLIT]], <3 x double> poison, <1 x i32> <i32 2>
760 ; CHECK-NEXT: [[TMP76:%.*]] = extractelement <3 x double> [[SPLIT4]], i64 0
761 ; CHECK-NEXT: [[SPLAT_SPLATINSERT14:%.*]] = insertelement <1 x double> poison, double [[TMP76]], i64 0
762 ; CHECK-NEXT: [[SPLAT_SPLAT15:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT14]], <1 x double> poison, <1 x i32> zeroinitializer
763 ; CHECK-NEXT: [[TMP77:%.*]] = fmul <1 x double> [[BLOCK13]], [[SPLAT_SPLAT15]]
764 ; CHECK-NEXT: [[BLOCK16:%.*]] = shufflevector <3 x double> [[SPLIT2]], <3 x double> poison, <1 x i32> <i32 2>
765 ; CHECK-NEXT: [[TMP78:%.*]] = extractelement <3 x double> [[SPLIT5]], i64 0
766 ; CHECK-NEXT: [[SPLAT_SPLATINSERT17:%.*]] = insertelement <1 x double> poison, double [[TMP78]], i64 0
767 ; CHECK-NEXT: [[SPLAT_SPLAT18:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT17]], <1 x double> poison, <1 x i32> zeroinitializer
768 ; CHECK-NEXT: [[TMP79:%.*]] = fmul <1 x double> [[BLOCK16]], [[SPLAT_SPLAT18]]
769 ; CHECK-NEXT: [[TMP80:%.*]] = fadd <1 x double> [[TMP77]], [[TMP79]]
770 ; CHECK-NEXT: [[BLOCK19:%.*]] = shufflevector <3 x double> [[SPLIT3]], <3 x double> poison, <1 x i32> <i32 2>
771 ; CHECK-NEXT: [[TMP81:%.*]] = extractelement <3 x double> [[SPLIT6]], i64 0
772 ; CHECK-NEXT: [[SPLAT_SPLATINSERT20:%.*]] = insertelement <1 x double> poison, double [[TMP81]], i64 0
773 ; CHECK-NEXT: [[SPLAT_SPLAT21:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT20]], <1 x double> poison, <1 x i32> zeroinitializer
774 ; CHECK-NEXT: [[TMP82:%.*]] = fmul <1 x double> [[BLOCK19]], [[SPLAT_SPLAT21]]
775 ; CHECK-NEXT: [[TMP83:%.*]] = fadd <1 x double> [[TMP80]], [[TMP82]]
776 ; CHECK-NEXT: [[TMP84:%.*]] = shufflevector <1 x double> [[TMP83]], <1 x double> poison, <3 x i32> <i32 0, i32 poison, i32 poison>
777 ; CHECK-NEXT: [[TMP85:%.*]] = shufflevector <3 x double> [[TMP75]], <3 x double> [[TMP84]], <3 x i32> <i32 0, i32 1, i32 3>
778 ; CHECK-NEXT: [[BLOCK22:%.*]] = shufflevector <3 x double> [[SPLIT]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
779 ; CHECK-NEXT: [[TMP86:%.*]] = extractelement <3 x double> [[SPLIT4]], i64 1
780 ; CHECK-NEXT: [[SPLAT_SPLATINSERT23:%.*]] = insertelement <2 x double> poison, double [[TMP86]], i64 0
781 ; CHECK-NEXT: [[SPLAT_SPLAT24:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT23]], <2 x double> poison, <2 x i32> zeroinitializer
782 ; CHECK-NEXT: [[TMP87:%.*]] = fmul <2 x double> [[BLOCK22]], [[SPLAT_SPLAT24]]
783 ; CHECK-NEXT: [[BLOCK25:%.*]] = shufflevector <3 x double> [[SPLIT2]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
784 ; CHECK-NEXT: [[TMP88:%.*]] = extractelement <3 x double> [[SPLIT5]], i64 1
785 ; CHECK-NEXT: [[SPLAT_SPLATINSERT26:%.*]] = insertelement <2 x double> poison, double [[TMP88]], i64 0
786 ; CHECK-NEXT: [[SPLAT_SPLAT27:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT26]], <2 x double> poison, <2 x i32> zeroinitializer
787 ; CHECK-NEXT: [[TMP89:%.*]] = fmul <2 x double> [[BLOCK25]], [[SPLAT_SPLAT27]]
788 ; CHECK-NEXT: [[TMP90:%.*]] = fadd <2 x double> [[TMP87]], [[TMP89]]
789 ; CHECK-NEXT: [[BLOCK28:%.*]] = shufflevector <3 x double> [[SPLIT3]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
790 ; CHECK-NEXT: [[TMP91:%.*]] = extractelement <3 x double> [[SPLIT6]], i64 1
791 ; CHECK-NEXT: [[SPLAT_SPLATINSERT29:%.*]] = insertelement <2 x double> poison, double [[TMP91]], i64 0
792 ; CHECK-NEXT: [[SPLAT_SPLAT30:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT29]], <2 x double> poison, <2 x i32> zeroinitializer
793 ; CHECK-NEXT: [[TMP92:%.*]] = fmul <2 x double> [[BLOCK28]], [[SPLAT_SPLAT30]]
794 ; CHECK-NEXT: [[TMP93:%.*]] = fadd <2 x double> [[TMP90]], [[TMP92]]
795 ; CHECK-NEXT: [[TMP94:%.*]] = shufflevector <2 x double> [[TMP93]], <2 x double> poison, <3 x i32> <i32 0, i32 1, i32 poison>
796 ; CHECK-NEXT: [[TMP95:%.*]] = shufflevector <3 x double> poison, <3 x double> [[TMP94]], <3 x i32> <i32 3, i32 4, i32 2>
797 ; CHECK-NEXT: [[BLOCK31:%.*]] = shufflevector <3 x double> [[SPLIT]], <3 x double> poison, <1 x i32> <i32 2>
798 ; CHECK-NEXT: [[TMP96:%.*]] = extractelement <3 x double> [[SPLIT4]], i64 1
799 ; CHECK-NEXT: [[SPLAT_SPLATINSERT32:%.*]] = insertelement <1 x double> poison, double [[TMP96]], i64 0
800 ; CHECK-NEXT: [[SPLAT_SPLAT33:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT32]], <1 x double> poison, <1 x i32> zeroinitializer
801 ; CHECK-NEXT: [[TMP97:%.*]] = fmul <1 x double> [[BLOCK31]], [[SPLAT_SPLAT33]]
802 ; CHECK-NEXT: [[BLOCK34:%.*]] = shufflevector <3 x double> [[SPLIT2]], <3 x double> poison, <1 x i32> <i32 2>
803 ; CHECK-NEXT: [[TMP98:%.*]] = extractelement <3 x double> [[SPLIT5]], i64 1
804 ; CHECK-NEXT: [[SPLAT_SPLATINSERT35:%.*]] = insertelement <1 x double> poison, double [[TMP98]], i64 0
805 ; CHECK-NEXT: [[SPLAT_SPLAT36:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT35]], <1 x double> poison, <1 x i32> zeroinitializer
806 ; CHECK-NEXT: [[TMP99:%.*]] = fmul <1 x double> [[BLOCK34]], [[SPLAT_SPLAT36]]
807 ; CHECK-NEXT: [[TMP100:%.*]] = fadd <1 x double> [[TMP97]], [[TMP99]]
808 ; CHECK-NEXT: [[BLOCK37:%.*]] = shufflevector <3 x double> [[SPLIT3]], <3 x double> poison, <1 x i32> <i32 2>
809 ; CHECK-NEXT: [[TMP101:%.*]] = extractelement <3 x double> [[SPLIT6]], i64 1
810 ; CHECK-NEXT: [[SPLAT_SPLATINSERT38:%.*]] = insertelement <1 x double> poison, double [[TMP101]], i64 0
811 ; CHECK-NEXT: [[SPLAT_SPLAT39:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT38]], <1 x double> poison, <1 x i32> zeroinitializer
812 ; CHECK-NEXT: [[TMP102:%.*]] = fmul <1 x double> [[BLOCK37]], [[SPLAT_SPLAT39]]
813 ; CHECK-NEXT: [[TMP103:%.*]] = fadd <1 x double> [[TMP100]], [[TMP102]]
814 ; CHECK-NEXT: [[TMP104:%.*]] = shufflevector <1 x double> [[TMP103]], <1 x double> poison, <3 x i32> <i32 0, i32 poison, i32 poison>
815 ; CHECK-NEXT: [[TMP105:%.*]] = shufflevector <3 x double> [[TMP95]], <3 x double> [[TMP104]], <3 x i32> <i32 0, i32 1, i32 3>
816 ; CHECK-NEXT: [[BLOCK40:%.*]] = shufflevector <3 x double> [[SPLIT]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
817 ; CHECK-NEXT: [[TMP106:%.*]] = extractelement <3 x double> [[SPLIT4]], i64 2
818 ; CHECK-NEXT: [[SPLAT_SPLATINSERT41:%.*]] = insertelement <2 x double> poison, double [[TMP106]], i64 0
819 ; CHECK-NEXT: [[SPLAT_SPLAT42:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT41]], <2 x double> poison, <2 x i32> zeroinitializer
820 ; CHECK-NEXT: [[TMP107:%.*]] = fmul <2 x double> [[BLOCK40]], [[SPLAT_SPLAT42]]
821 ; CHECK-NEXT: [[BLOCK43:%.*]] = shufflevector <3 x double> [[SPLIT2]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
822 ; CHECK-NEXT: [[TMP108:%.*]] = extractelement <3 x double> [[SPLIT5]], i64 2
823 ; CHECK-NEXT: [[SPLAT_SPLATINSERT44:%.*]] = insertelement <2 x double> poison, double [[TMP108]], i64 0
824 ; CHECK-NEXT: [[SPLAT_SPLAT45:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT44]], <2 x double> poison, <2 x i32> zeroinitializer
825 ; CHECK-NEXT: [[TMP109:%.*]] = fmul <2 x double> [[BLOCK43]], [[SPLAT_SPLAT45]]
826 ; CHECK-NEXT: [[TMP110:%.*]] = fadd <2 x double> [[TMP107]], [[TMP109]]
827 ; CHECK-NEXT: [[BLOCK46:%.*]] = shufflevector <3 x double> [[SPLIT3]], <3 x double> poison, <2 x i32> <i32 0, i32 1>
828 ; CHECK-NEXT: [[TMP111:%.*]] = extractelement <3 x double> [[SPLIT6]], i64 2
829 ; CHECK-NEXT: [[SPLAT_SPLATINSERT47:%.*]] = insertelement <2 x double> poison, double [[TMP111]], i64 0
830 ; CHECK-NEXT: [[SPLAT_SPLAT48:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT47]], <2 x double> poison, <2 x i32> zeroinitializer
831 ; CHECK-NEXT: [[TMP112:%.*]] = fmul <2 x double> [[BLOCK46]], [[SPLAT_SPLAT48]]
832 ; CHECK-NEXT: [[TMP113:%.*]] = fadd <2 x double> [[TMP110]], [[TMP112]]
833 ; CHECK-NEXT: [[TMP114:%.*]] = shufflevector <2 x double> [[TMP113]], <2 x double> poison, <3 x i32> <i32 0, i32 1, i32 poison>
834 ; CHECK-NEXT: [[TMP115:%.*]] = shufflevector <3 x double> poison, <3 x double> [[TMP114]], <3 x i32> <i32 3, i32 4, i32 2>
835 ; CHECK-NEXT: [[BLOCK49:%.*]] = shufflevector <3 x double> [[SPLIT]], <3 x double> poison, <1 x i32> <i32 2>
836 ; CHECK-NEXT: [[TMP116:%.*]] = extractelement <3 x double> [[SPLIT4]], i64 2
837 ; CHECK-NEXT: [[SPLAT_SPLATINSERT50:%.*]] = insertelement <1 x double> poison, double [[TMP116]], i64 0
838 ; CHECK-NEXT: [[SPLAT_SPLAT51:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT50]], <1 x double> poison, <1 x i32> zeroinitializer
839 ; CHECK-NEXT: [[TMP117:%.*]] = fmul <1 x double> [[BLOCK49]], [[SPLAT_SPLAT51]]
840 ; CHECK-NEXT: [[BLOCK52:%.*]] = shufflevector <3 x double> [[SPLIT2]], <3 x double> poison, <1 x i32> <i32 2>
841 ; CHECK-NEXT: [[TMP118:%.*]] = extractelement <3 x double> [[SPLIT5]], i64 2
842 ; CHECK-NEXT: [[SPLAT_SPLATINSERT53:%.*]] = insertelement <1 x double> poison, double [[TMP118]], i64 0
843 ; CHECK-NEXT: [[SPLAT_SPLAT54:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT53]], <1 x double> poison, <1 x i32> zeroinitializer
844 ; CHECK-NEXT: [[TMP119:%.*]] = fmul <1 x double> [[BLOCK52]], [[SPLAT_SPLAT54]]
845 ; CHECK-NEXT: [[TMP120:%.*]] = fadd <1 x double> [[TMP117]], [[TMP119]]
846 ; CHECK-NEXT: [[BLOCK55:%.*]] = shufflevector <3 x double> [[SPLIT3]], <3 x double> poison, <1 x i32> <i32 2>
847 ; CHECK-NEXT: [[TMP121:%.*]] = extractelement <3 x double> [[SPLIT6]], i64 2
848 ; CHECK-NEXT: [[SPLAT_SPLATINSERT56:%.*]] = insertelement <1 x double> poison, double [[TMP121]], i64 0
849 ; CHECK-NEXT: [[SPLAT_SPLAT57:%.*]] = shufflevector <1 x double> [[SPLAT_SPLATINSERT56]], <1 x double> poison, <1 x i32> zeroinitializer
850 ; CHECK-NEXT: [[TMP122:%.*]] = fmul <1 x double> [[BLOCK55]], [[SPLAT_SPLAT57]]
851 ; CHECK-NEXT: [[TMP123:%.*]] = fadd <1 x double> [[TMP120]], [[TMP122]]
852 ; CHECK-NEXT: [[TMP124:%.*]] = shufflevector <1 x double> [[TMP123]], <1 x double> poison, <3 x i32> <i32 0, i32 poison, i32 poison>
853 ; CHECK-NEXT: [[TMP125:%.*]] = shufflevector <3 x double> [[TMP115]], <3 x double> [[TMP124]], <3 x i32> <i32 0, i32 1, i32 3>
854 ; CHECK-NEXT: store <3 x double> [[TMP85]], ptr [[R:%.*]], align 16
855 ; CHECK-NEXT: [[VEC_GEP125:%.*]] = getelementptr double, ptr [[R]], i64 3
856 ; CHECK-NEXT: store <3 x double> [[TMP105]], ptr [[VEC_GEP125]], align 8
857 ; CHECK-NEXT: [[VEC_GEP126:%.*]] = getelementptr double, ptr [[R]], i64 6
858 ; CHECK-NEXT: store <3 x double> [[TMP125]], ptr [[VEC_GEP126]], align 16
859 ; CHECK-NEXT: ret void
862 %a = load <9 x double>, ptr %A, align 16
863 %b = load <9 x double>, ptr %B, align 16
864 %bt = call <9 x double> @llvm.matrix.transpose.v9f64.v9f64(<9 x double> %b, i32 3, i32 3)
865 %c = load <9 x double>, ptr %C, align 16
866 %ct = call <9 x double> @llvm.matrix.transpose.v9f64.v9f64(<9 x double> %c, i32 3, i32 3)
867 %btct = call <9 x double> @llvm.matrix.multiply.v9f64.v9f64.v9f64(<9 x double> %bt, <9 x double> %ct, i32 3, i32 3, i32 3)
868 %abtct= call <9 x double> @llvm.matrix.multiply.v9f64.v9f64.v9f64(<9 x double> %a, <9 x double> %btct, i32 3, i32 3, i32 3)
869 %abtct_t = call <9 x double> @llvm.matrix.transpose.v9f64.v9f64(<9 x double> %abtct, i32 3, i32 3)
870 store <9 x double> %abtct_t, ptr %R, align 16
874 define <4 x float> @mult_tt_same_op(<4 x float> %a) {
875 ; CHECK-LABEL: @mult_tt_same_op(
877 ; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> poison, <2 x i32> <i32 0, i32 1>
878 ; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <4 x float> [[A]], <4 x float> poison, <2 x i32> <i32 2, i32 3>
879 ; CHECK-NEXT: [[SPLIT2:%.*]] = shufflevector <4 x float> [[A]], <4 x float> poison, <2 x i32> <i32 0, i32 1>
880 ; CHECK-NEXT: [[SPLIT3:%.*]] = shufflevector <4 x float> [[A]], <4 x float> poison, <2 x i32> <i32 2, i32 3>
881 ; CHECK-NEXT: [[BLOCK:%.*]] = shufflevector <2 x float> [[SPLIT]], <2 x float> poison, <2 x i32> <i32 0, i32 1>
882 ; CHECK-NEXT: [[TMP0:%.*]] = extractelement <2 x float> [[SPLIT2]], i64 0
883 ; CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <2 x float> poison, float [[TMP0]], i64 0
884 ; CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <2 x float> [[SPLAT_SPLATINSERT]], <2 x float> poison, <2 x i32> zeroinitializer
885 ; CHECK-NEXT: [[TMP1:%.*]] = fmul <2 x float> [[BLOCK]], [[SPLAT_SPLAT]]
886 ; CHECK-NEXT: [[BLOCK4:%.*]] = shufflevector <2 x float> [[SPLIT1]], <2 x float> poison, <2 x i32> <i32 0, i32 1>
887 ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <2 x float> [[SPLIT2]], i64 1
888 ; CHECK-NEXT: [[SPLAT_SPLATINSERT5:%.*]] = insertelement <2 x float> poison, float [[TMP2]], i64 0
889 ; CHECK-NEXT: [[SPLAT_SPLAT6:%.*]] = shufflevector <2 x float> [[SPLAT_SPLATINSERT5]], <2 x float> poison, <2 x i32> zeroinitializer
890 ; CHECK-NEXT: [[TMP3:%.*]] = fmul <2 x float> [[BLOCK4]], [[SPLAT_SPLAT6]]
891 ; CHECK-NEXT: [[TMP4:%.*]] = fadd <2 x float> [[TMP1]], [[TMP3]]
892 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <2 x float> [[TMP4]], <2 x float> poison, <2 x i32> <i32 0, i32 1>
893 ; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <2 x float> poison, <2 x float> [[TMP5]], <2 x i32> <i32 2, i32 3>
894 ; CHECK-NEXT: [[BLOCK7:%.*]] = shufflevector <2 x float> [[SPLIT]], <2 x float> poison, <2 x i32> <i32 0, i32 1>
895 ; CHECK-NEXT: [[TMP7:%.*]] = extractelement <2 x float> [[SPLIT3]], i64 0
896 ; CHECK-NEXT: [[SPLAT_SPLATINSERT8:%.*]] = insertelement <2 x float> poison, float [[TMP7]], i64 0
897 ; CHECK-NEXT: [[SPLAT_SPLAT9:%.*]] = shufflevector <2 x float> [[SPLAT_SPLATINSERT8]], <2 x float> poison, <2 x i32> zeroinitializer
898 ; CHECK-NEXT: [[TMP8:%.*]] = fmul <2 x float> [[BLOCK7]], [[SPLAT_SPLAT9]]
899 ; CHECK-NEXT: [[BLOCK10:%.*]] = shufflevector <2 x float> [[SPLIT1]], <2 x float> poison, <2 x i32> <i32 0, i32 1>
900 ; CHECK-NEXT: [[TMP9:%.*]] = extractelement <2 x float> [[SPLIT3]], i64 1
901 ; CHECK-NEXT: [[SPLAT_SPLATINSERT11:%.*]] = insertelement <2 x float> poison, float [[TMP9]], i64 0
902 ; CHECK-NEXT: [[SPLAT_SPLAT12:%.*]] = shufflevector <2 x float> [[SPLAT_SPLATINSERT11]], <2 x float> poison, <2 x i32> zeroinitializer
903 ; CHECK-NEXT: [[TMP10:%.*]] = fmul <2 x float> [[BLOCK10]], [[SPLAT_SPLAT12]]
904 ; CHECK-NEXT: [[TMP11:%.*]] = fadd <2 x float> [[TMP8]], [[TMP10]]
905 ; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <2 x float> [[TMP11]], <2 x float> poison, <2 x i32> <i32 0, i32 1>
906 ; CHECK-NEXT: [[TMP13:%.*]] = shufflevector <2 x float> poison, <2 x float> [[TMP12]], <2 x i32> <i32 2, i32 3>
907 ; CHECK-NEXT: [[TMP14:%.*]] = extractelement <2 x float> [[TMP6]], i64 0
908 ; CHECK-NEXT: [[TMP15:%.*]] = insertelement <2 x float> poison, float [[TMP14]], i64 0
909 ; CHECK-NEXT: [[TMP16:%.*]] = extractelement <2 x float> [[TMP13]], i64 0
910 ; CHECK-NEXT: [[TMP17:%.*]] = insertelement <2 x float> [[TMP15]], float [[TMP16]], i64 1
911 ; CHECK-NEXT: [[TMP18:%.*]] = extractelement <2 x float> [[TMP6]], i64 1
912 ; CHECK-NEXT: [[TMP19:%.*]] = insertelement <2 x float> poison, float [[TMP18]], i64 0
913 ; CHECK-NEXT: [[TMP20:%.*]] = extractelement <2 x float> [[TMP13]], i64 1
914 ; CHECK-NEXT: [[TMP21:%.*]] = insertelement <2 x float> [[TMP19]], float [[TMP20]], i64 1
915 ; CHECK-NEXT: [[TMP22:%.*]] = shufflevector <2 x float> [[TMP17]], <2 x float> [[TMP21]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
916 ; CHECK-NEXT: ret <4 x float> [[TMP22]]
919 %t = call <4 x float> @llvm.matrix.transpose.v4f32(<4 x float> %a, i32 2, i32 2)
920 %m = call <4 x float> @llvm.matrix.multiply.v4f32.v4f32.v4f32(<4 x float> %t, <4 x float> %t, i32 2, i32 2, i32 2)
924 define <6 x double> @transpose_of_transpose_of_non_matrix_op(ptr %a) {
925 ; CHECK-LABEL: @transpose_of_transpose_of_non_matrix_op(
926 ; CHECK-NEXT: [[COL_LOAD:%.*]] = load <2 x double>, ptr [[A:%.*]], align 8
927 ; CHECK-NEXT: [[VEC_GEP:%.*]] = getelementptr double, ptr [[A]], i64 4
928 ; CHECK-NEXT: [[COL_LOAD1:%.*]] = load <2 x double>, ptr [[VEC_GEP]], align 8
929 ; CHECK-NEXT: [[VEC_GEP2:%.*]] = getelementptr double, ptr [[A]], i64 8
930 ; CHECK-NEXT: [[COL_LOAD3:%.*]] = load <2 x double>, ptr [[VEC_GEP2]], align 8
931 ; CHECK-NEXT: [[VEC_GEP4:%.*]] = getelementptr double, ptr [[A]], i64 12
932 ; CHECK-NEXT: [[COL_LOAD5:%.*]] = load <2 x double>, ptr [[VEC_GEP4]], align 8
933 ; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x double> [[COL_LOAD]], <2 x double> [[COL_LOAD1]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
934 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x double> [[COL_LOAD3]], <2 x double> [[COL_LOAD5]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
935 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <4 x double> [[TMP1]], <4 x double> [[TMP2]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
936 ; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <8 x double> [[TMP3]], <8 x double> poison, <6 x i32> <i32 0, i32 1, i32 2, i32 4, i32 5, i32 6>
937 ; CHECK-NEXT: ret <6 x double> [[SHUF]]
939 %load = call <8 x double> @llvm.matrix.column.major.load.v8f64(ptr %a, i64 4, i1 false, i32 2, i32 4)
940 %shuf = shufflevector <8 x double> %load, <8 x double> poison, <6 x i32> <i32 0, i32 1, i32 2, i32 4, i32 5, i32 6>
941 %t = call <6 x double> @llvm.matrix.transpose.v6f64.v6f64(<6 x double> %shuf, i32 3, i32 2)
942 %tt = call <6 x double> @llvm.matrix.transpose.v6f64.v6f64(<6 x double> %t, i32 2, i32 3)
946 define <12 x double> @factor_transpose(<6 x double> %a, <8 x double> %b) {
947 ; CHECK-LABEL: @factor_transpose(
948 ; CHECK-NEXT: [[SPLIT:%.*]] = shufflevector <8 x double> [[B:%.*]], <8 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
949 ; CHECK-NEXT: [[SPLIT1:%.*]] = shufflevector <8 x double> [[B]], <8 x double> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
950 ; CHECK-NEXT: [[SPLIT2:%.*]] = shufflevector <6 x double> [[A:%.*]], <6 x double> poison, <2 x i32> <i32 0, i32 1>
951 ; CHECK-NEXT: [[SPLIT3:%.*]] = shufflevector <6 x double> [[A]], <6 x double> poison, <2 x i32> <i32 2, i32 3>
952 ; CHECK-NEXT: [[SPLIT4:%.*]] = shufflevector <6 x double> [[A]], <6 x double> poison, <2 x i32> <i32 4, i32 5>
953 ; CHECK-NEXT: [[BLOCK:%.*]] = shufflevector <4 x double> [[SPLIT]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
954 ; CHECK-NEXT: [[TMP1:%.*]] = extractelement <2 x double> [[SPLIT2]], i64 0
955 ; CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <2 x double> poison, double [[TMP1]], i64 0
956 ; CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT]], <2 x double> poison, <2 x i32> zeroinitializer
957 ; CHECK-NEXT: [[TMP2:%.*]] = fmul <2 x double> [[BLOCK]], [[SPLAT_SPLAT]]
958 ; CHECK-NEXT: [[BLOCK5:%.*]] = shufflevector <4 x double> [[SPLIT1]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
959 ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x double> [[SPLIT2]], i64 1
960 ; CHECK-NEXT: [[SPLAT_SPLATINSERT6:%.*]] = insertelement <2 x double> poison, double [[TMP3]], i64 0
961 ; CHECK-NEXT: [[SPLAT_SPLAT7:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT6]], <2 x double> poison, <2 x i32> zeroinitializer
962 ; CHECK-NEXT: [[TMP4:%.*]] = fmul <2 x double> [[BLOCK5]], [[SPLAT_SPLAT7]]
963 ; CHECK-NEXT: [[TMP5:%.*]] = fadd <2 x double> [[TMP2]], [[TMP4]]
964 ; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <2 x double> [[TMP5]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
965 ; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <4 x double> poison, <4 x double> [[TMP6]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
966 ; CHECK-NEXT: [[BLOCK8:%.*]] = shufflevector <4 x double> [[SPLIT]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
967 ; CHECK-NEXT: [[TMP8:%.*]] = extractelement <2 x double> [[SPLIT2]], i64 0
968 ; CHECK-NEXT: [[SPLAT_SPLATINSERT9:%.*]] = insertelement <2 x double> poison, double [[TMP8]], i64 0
969 ; CHECK-NEXT: [[SPLAT_SPLAT10:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT9]], <2 x double> poison, <2 x i32> zeroinitializer
970 ; CHECK-NEXT: [[TMP9:%.*]] = fmul <2 x double> [[BLOCK8]], [[SPLAT_SPLAT10]]
971 ; CHECK-NEXT: [[BLOCK11:%.*]] = shufflevector <4 x double> [[SPLIT1]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
972 ; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x double> [[SPLIT2]], i64 1
973 ; CHECK-NEXT: [[SPLAT_SPLATINSERT12:%.*]] = insertelement <2 x double> poison, double [[TMP10]], i64 0
974 ; CHECK-NEXT: [[SPLAT_SPLAT13:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT12]], <2 x double> poison, <2 x i32> zeroinitializer
975 ; CHECK-NEXT: [[TMP11:%.*]] = fmul <2 x double> [[BLOCK11]], [[SPLAT_SPLAT13]]
976 ; CHECK-NEXT: [[TMP12:%.*]] = fadd <2 x double> [[TMP9]], [[TMP11]]
977 ; CHECK-NEXT: [[TMP13:%.*]] = shufflevector <2 x double> [[TMP12]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
978 ; CHECK-NEXT: [[TMP14:%.*]] = shufflevector <4 x double> [[TMP7]], <4 x double> [[TMP13]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
979 ; CHECK-NEXT: [[BLOCK14:%.*]] = shufflevector <4 x double> [[SPLIT]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
980 ; CHECK-NEXT: [[TMP15:%.*]] = extractelement <2 x double> [[SPLIT3]], i64 0
981 ; CHECK-NEXT: [[SPLAT_SPLATINSERT15:%.*]] = insertelement <2 x double> poison, double [[TMP15]], i64 0
982 ; CHECK-NEXT: [[SPLAT_SPLAT16:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT15]], <2 x double> poison, <2 x i32> zeroinitializer
983 ; CHECK-NEXT: [[TMP16:%.*]] = fmul <2 x double> [[BLOCK14]], [[SPLAT_SPLAT16]]
984 ; CHECK-NEXT: [[BLOCK17:%.*]] = shufflevector <4 x double> [[SPLIT1]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
985 ; CHECK-NEXT: [[TMP17:%.*]] = extractelement <2 x double> [[SPLIT3]], i64 1
986 ; CHECK-NEXT: [[SPLAT_SPLATINSERT18:%.*]] = insertelement <2 x double> poison, double [[TMP17]], i64 0
987 ; CHECK-NEXT: [[SPLAT_SPLAT19:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT18]], <2 x double> poison, <2 x i32> zeroinitializer
988 ; CHECK-NEXT: [[TMP18:%.*]] = fmul <2 x double> [[BLOCK17]], [[SPLAT_SPLAT19]]
989 ; CHECK-NEXT: [[TMP19:%.*]] = fadd <2 x double> [[TMP16]], [[TMP18]]
990 ; CHECK-NEXT: [[TMP20:%.*]] = shufflevector <2 x double> [[TMP19]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
991 ; CHECK-NEXT: [[TMP21:%.*]] = shufflevector <4 x double> poison, <4 x double> [[TMP20]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
992 ; CHECK-NEXT: [[BLOCK20:%.*]] = shufflevector <4 x double> [[SPLIT]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
993 ; CHECK-NEXT: [[TMP22:%.*]] = extractelement <2 x double> [[SPLIT3]], i64 0
994 ; CHECK-NEXT: [[SPLAT_SPLATINSERT21:%.*]] = insertelement <2 x double> poison, double [[TMP22]], i64 0
995 ; CHECK-NEXT: [[SPLAT_SPLAT22:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT21]], <2 x double> poison, <2 x i32> zeroinitializer
996 ; CHECK-NEXT: [[TMP23:%.*]] = fmul <2 x double> [[BLOCK20]], [[SPLAT_SPLAT22]]
997 ; CHECK-NEXT: [[BLOCK23:%.*]] = shufflevector <4 x double> [[SPLIT1]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
998 ; CHECK-NEXT: [[TMP24:%.*]] = extractelement <2 x double> [[SPLIT3]], i64 1
999 ; CHECK-NEXT: [[SPLAT_SPLATINSERT24:%.*]] = insertelement <2 x double> poison, double [[TMP24]], i64 0
1000 ; CHECK-NEXT: [[SPLAT_SPLAT25:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT24]], <2 x double> poison, <2 x i32> zeroinitializer
1001 ; CHECK-NEXT: [[TMP25:%.*]] = fmul <2 x double> [[BLOCK23]], [[SPLAT_SPLAT25]]
1002 ; CHECK-NEXT: [[TMP26:%.*]] = fadd <2 x double> [[TMP23]], [[TMP25]]
1003 ; CHECK-NEXT: [[TMP27:%.*]] = shufflevector <2 x double> [[TMP26]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
1004 ; CHECK-NEXT: [[TMP28:%.*]] = shufflevector <4 x double> [[TMP21]], <4 x double> [[TMP27]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
1005 ; CHECK-NEXT: [[BLOCK26:%.*]] = shufflevector <4 x double> [[SPLIT]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
1006 ; CHECK-NEXT: [[TMP29:%.*]] = extractelement <2 x double> [[SPLIT4]], i64 0
1007 ; CHECK-NEXT: [[SPLAT_SPLATINSERT27:%.*]] = insertelement <2 x double> poison, double [[TMP29]], i64 0
1008 ; CHECK-NEXT: [[SPLAT_SPLAT28:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT27]], <2 x double> poison, <2 x i32> zeroinitializer
1009 ; CHECK-NEXT: [[TMP30:%.*]] = fmul <2 x double> [[BLOCK26]], [[SPLAT_SPLAT28]]
1010 ; CHECK-NEXT: [[BLOCK29:%.*]] = shufflevector <4 x double> [[SPLIT1]], <4 x double> poison, <2 x i32> <i32 0, i32 1>
1011 ; CHECK-NEXT: [[TMP31:%.*]] = extractelement <2 x double> [[SPLIT4]], i64 1
1012 ; CHECK-NEXT: [[SPLAT_SPLATINSERT30:%.*]] = insertelement <2 x double> poison, double [[TMP31]], i64 0
1013 ; CHECK-NEXT: [[SPLAT_SPLAT31:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT30]], <2 x double> poison, <2 x i32> zeroinitializer
1014 ; CHECK-NEXT: [[TMP32:%.*]] = fmul <2 x double> [[BLOCK29]], [[SPLAT_SPLAT31]]
1015 ; CHECK-NEXT: [[TMP33:%.*]] = fadd <2 x double> [[TMP30]], [[TMP32]]
1016 ; CHECK-NEXT: [[TMP34:%.*]] = shufflevector <2 x double> [[TMP33]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
1017 ; CHECK-NEXT: [[TMP35:%.*]] = shufflevector <4 x double> poison, <4 x double> [[TMP34]], <4 x i32> <i32 4, i32 5, i32 2, i32 3>
1018 ; CHECK-NEXT: [[BLOCK32:%.*]] = shufflevector <4 x double> [[SPLIT]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
1019 ; CHECK-NEXT: [[TMP36:%.*]] = extractelement <2 x double> [[SPLIT4]], i64 0
1020 ; CHECK-NEXT: [[SPLAT_SPLATINSERT33:%.*]] = insertelement <2 x double> poison, double [[TMP36]], i64 0
1021 ; CHECK-NEXT: [[SPLAT_SPLAT34:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT33]], <2 x double> poison, <2 x i32> zeroinitializer
1022 ; CHECK-NEXT: [[TMP37:%.*]] = fmul <2 x double> [[BLOCK32]], [[SPLAT_SPLAT34]]
1023 ; CHECK-NEXT: [[BLOCK35:%.*]] = shufflevector <4 x double> [[SPLIT1]], <4 x double> poison, <2 x i32> <i32 2, i32 3>
1024 ; CHECK-NEXT: [[TMP38:%.*]] = extractelement <2 x double> [[SPLIT4]], i64 1
1025 ; CHECK-NEXT: [[SPLAT_SPLATINSERT36:%.*]] = insertelement <2 x double> poison, double [[TMP38]], i64 0
1026 ; CHECK-NEXT: [[SPLAT_SPLAT37:%.*]] = shufflevector <2 x double> [[SPLAT_SPLATINSERT36]], <2 x double> poison, <2 x i32> zeroinitializer
1027 ; CHECK-NEXT: [[TMP39:%.*]] = fmul <2 x double> [[BLOCK35]], [[SPLAT_SPLAT37]]
1028 ; CHECK-NEXT: [[TMP40:%.*]] = fadd <2 x double> [[TMP37]], [[TMP39]]
1029 ; CHECK-NEXT: [[TMP41:%.*]] = shufflevector <2 x double> [[TMP40]], <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
1030 ; CHECK-NEXT: [[TMP42:%.*]] = shufflevector <4 x double> [[TMP35]], <4 x double> [[TMP41]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
1031 ; CHECK-NEXT: [[TMP43:%.*]] = extractelement <4 x double> [[TMP14]], i64 0
1032 ; CHECK-NEXT: [[TMP44:%.*]] = insertelement <3 x double> poison, double [[TMP43]], i64 0
1033 ; CHECK-NEXT: [[TMP45:%.*]] = extractelement <4 x double> [[TMP28]], i64 0
1034 ; CHECK-NEXT: [[TMP46:%.*]] = insertelement <3 x double> [[TMP44]], double [[TMP45]], i64 1
1035 ; CHECK-NEXT: [[TMP47:%.*]] = extractelement <4 x double> [[TMP42]], i64 0
1036 ; CHECK-NEXT: [[TMP48:%.*]] = insertelement <3 x double> [[TMP46]], double [[TMP47]], i64 2
1037 ; CHECK-NEXT: [[TMP49:%.*]] = extractelement <4 x double> [[TMP14]], i64 1
1038 ; CHECK-NEXT: [[TMP50:%.*]] = insertelement <3 x double> poison, double [[TMP49]], i64 0
1039 ; CHECK-NEXT: [[TMP51:%.*]] = extractelement <4 x double> [[TMP28]], i64 1
1040 ; CHECK-NEXT: [[TMP52:%.*]] = insertelement <3 x double> [[TMP50]], double [[TMP51]], i64 1
1041 ; CHECK-NEXT: [[TMP53:%.*]] = extractelement <4 x double> [[TMP42]], i64 1
1042 ; CHECK-NEXT: [[TMP54:%.*]] = insertelement <3 x double> [[TMP52]], double [[TMP53]], i64 2
1043 ; CHECK-NEXT: [[TMP55:%.*]] = extractelement <4 x double> [[TMP14]], i64 2
1044 ; CHECK-NEXT: [[TMP56:%.*]] = insertelement <3 x double> poison, double [[TMP55]], i64 0
1045 ; CHECK-NEXT: [[TMP57:%.*]] = extractelement <4 x double> [[TMP28]], i64 2
1046 ; CHECK-NEXT: [[TMP58:%.*]] = insertelement <3 x double> [[TMP56]], double [[TMP57]], i64 1
1047 ; CHECK-NEXT: [[TMP59:%.*]] = extractelement <4 x double> [[TMP42]], i64 2
1048 ; CHECK-NEXT: [[TMP60:%.*]] = insertelement <3 x double> [[TMP58]], double [[TMP59]], i64 2
1049 ; CHECK-NEXT: [[TMP61:%.*]] = extractelement <4 x double> [[TMP14]], i64 3
1050 ; CHECK-NEXT: [[TMP62:%.*]] = insertelement <3 x double> poison, double [[TMP61]], i64 0
1051 ; CHECK-NEXT: [[TMP63:%.*]] = extractelement <4 x double> [[TMP28]], i64 3
1052 ; CHECK-NEXT: [[TMP64:%.*]] = insertelement <3 x double> [[TMP62]], double [[TMP63]], i64 1
1053 ; CHECK-NEXT: [[TMP65:%.*]] = extractelement <4 x double> [[TMP42]], i64 3
1054 ; CHECK-NEXT: [[TMP66:%.*]] = insertelement <3 x double> [[TMP64]], double [[TMP65]], i64 2
1055 ; CHECK-NEXT: [[TMP67:%.*]] = shufflevector <3 x double> [[TMP48]], <3 x double> [[TMP54]], <6 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5>
1056 ; CHECK-NEXT: [[TMP68:%.*]] = shufflevector <3 x double> [[TMP60]], <3 x double> [[TMP66]], <6 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5>
1057 ; CHECK-NEXT: [[TMP69:%.*]] = shufflevector <6 x double> [[TMP67]], <6 x double> [[TMP68]], <12 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11>
1058 ; CHECK-NEXT: ret <12 x double> [[TMP69]]
1060 %at = call <6 x double> @llvm.matrix.transpose.v6f64.v6f64(<6 x double> %a, i32 2, i32 3)
1061 %bt = call <8 x double> @llvm.matrix.transpose.v8f64.v8f64(<8 x double> %b, i32 4, i32 2)
1062 %m = call <12 x double> @llvm.matrix.multiply.v12f64.v6f64.v8f64(<6 x double> %at, <8 x double> %bt, i32 3, i32 2, i32 4)
1063 ret <12 x double> %m
1066 declare <9 x double> @llvm.matrix.multiply.v9f64.v9f64.v9f64(<9 x double>, <9 x double>, i32, i32, i32)
1067 declare <12 x double> @llvm.matrix.multiply.v12f64.v6f64.v8f64(<6 x double>, <8 x double>, i32, i32, i32)
1068 declare <8 x double> @llvm.matrix.multiply.v8f64.v6f64.v12f64(<6 x double> %a, <12 x double>, i32, i32, i32)
1069 declare <4 x float> @llvm.matrix.multiply.v4f32.v4f32.v4f32(<4 x float>, <4 x float>, i32, i32, i32)
1070 declare <9 x double> @llvm.matrix.transpose.v9f64.v9f64(<9 x double>, i32, i32)
1071 declare <6 x double> @llvm.matrix.transpose.v6f64.v6f64(<6 x double>, i32, i32)
1072 declare <8 x double> @llvm.matrix.transpose.v8f64.v8f64(<8 x double>, i32, i32)
1073 declare <12 x double> @llvm.matrix.transpose.v12f64.v12f64(<12 x double>, i32, i32)
1074 declare <4 x float> @llvm.matrix.transpose.v4f32(<4 x float>, i32, i32)
1075 declare <8 x double> @llvm.matrix.column.major.load.v8f64(ptr, i64, i1, i32, i32)