File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: mlir-opt -canonicalize %s | FileCheck %s
2+
3+ // Check that linalg.index does not cause folding of affine.if set to
4+ // a symbolic set.
5+
6+ // CHECK: = affine_set<(d0) : (-d0 + 5 >= 0)>
7+ #set = affine_set <(d0 ) : (-d0 + 5 >= 0 )>
8+
9+ func.func @linalg_index_affine_if (%in: tensor <10 xf32 >) -> tensor <10 xf32 > {
10+ %empty = tensor.empty () : tensor <10 xf32 >
11+ %out = linalg.generic {
12+ indexing_maps = [affine_map <(i ) -> (i )>, affine_map <(i ) -> (i )>],
13+ iterator_types = [" parallel" ]}
14+ ins (%in : tensor <10 xf32 >)
15+ outs (%empty : tensor <10 xf32 >) {
16+ ^bb0 (%a: f32 , %b: f32 ):
17+ %c42f = arith.constant 42.0 : f32
18+ %i = linalg.index 0 : index
19+ %ret = affine.if #set (%i ) -> f32 {
20+ affine.yield %a : f32
21+ } else {
22+ affine.yield %c42f : f32
23+ }
24+ linalg.yield %ret : f32
25+ } -> tensor <10 xf32 >
26+ return %out : tensor <10 xf32 >
27+ }
You can’t perform that action at this time.
0 commit comments