8 static void access_collect_arrays(struct pet_expr
*expr
,
9 set
<ValueDecl
*> &arrays
)
14 if (!isl_map_has_tuple_id(expr
->acc
.access
, isl_dim_out
))
16 id
= isl_map_get_tuple_id(expr
->acc
.access
, isl_dim_out
);
20 decl
= (ValueDecl
*)isl_id_get_user(id
);
26 static void expr_collect_arrays(struct pet_expr
*expr
, set
<ValueDecl
*> &arrays
)
31 for (int i
= 0; i
< expr
->n_arg
; ++i
)
32 expr_collect_arrays(expr
->args
[i
], arrays
);
34 if (expr
->type
== pet_expr_access
)
35 access_collect_arrays(expr
, arrays
);
38 static void stmt_collect_arrays(struct pet_stmt
*stmt
, set
<ValueDecl
*> &arrays
)
42 expr_collect_arrays(stmt
->body
, arrays
);
45 /* Collect the set of all accessed arrays (or scalars) in "scop"
46 * and put them in "arrays".
48 void pet_scop_collect_arrays(struct pet_scop
*scop
, set
<ValueDecl
*> &arrays
)
53 for (int i
= 0; i
< scop
->n_stmt
; ++i
)
54 stmt_collect_arrays(scop
->stmts
[i
], arrays
);