File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,29 @@ func.func @fold_extract_transpose_negative(%arg0: vector<4x4xf16>) -> vector<4x4
1111 %2 = vector.extract %1 [0 ] : vector <4 x4 xf16 > from vector <1 x4 x4 xf16 >
1212 return %2 : vector <4 x4 xf16 >
1313}
14+
15+ // -----
16+
17+ // CHECK-LABEL: fold_extract_in_single_pass
18+ // CHECK-SAME: (%{{.*}}: vector<4xf16>, %[[ARG1:.+]]: f16)
19+ func.func @fold_extract_in_single_pass (%arg0: vector <4 xf16 >, %arg1: f16 ) -> f16 {
20+ %0 = vector.insert %arg1 , %arg0 [1 ] : f16 into vector <4 xf16 >
21+ %c1 = arith.constant 1 : index
22+ // Verify that the fold is finished in a single pass even if the index is dynamic.
23+ %1 = vector.extract %0 [%c1 ] : f16 from vector <4 xf16 >
24+ // CHECK: return %[[ARG1]] : f16
25+ return %1 : f16
26+ }
27+
28+ // -----
29+
30+ // CHECK-LABEL: fold_insert_in_single_pass
31+ func.func @fold_insert_in_single_pass () -> vector <2 xf16 > {
32+ %cst = arith.constant dense <0.000000e+00 > : vector <2 xf16 >
33+ %c1 = arith.constant 1 : index
34+ %c2 = arith.constant 2.5 : f16
35+ // Verify that the fold is finished in a single pass even if the index is dynamic.
36+ // CHECK: arith.constant dense<[0.000000e+00, 2.500000e+00]> : vector<2xf16>
37+ %0 = vector.insert %c2 , %cst [%c1 ] : f16 into vector <2 xf16 >
38+ return %0 : vector <2 xf16 >
39+ }
You can’t perform that action at this time.
0 commit comments