From 6e59297080bcd0b7e6e93a912fb87ebb05cfe06e Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 8 Dec 2014 13:46:55 +0100 Subject: [PATCH] gpu.c: collect_references: also collect references for arrays of structs This will allow us to compute array reference groups for them. Signed-off-by: Sven Verdoolaege --- gpu.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/gpu.c b/gpu.c index 3d32af2..a4ad78c 100644 --- a/gpu.c +++ b/gpu.c @@ -54,9 +54,6 @@ static const char *get_outer_array_name(__isl_keep isl_map *access) /* Collect all references to the given array and store pointers to them * in array->refs. - * - * If the array contains structures, then there is no need to collect - * the references since we will not be computing any reference groups. */ static void collect_references(struct gpu_prog *prog, struct gpu_array_info *array) @@ -64,9 +61,6 @@ static void collect_references(struct gpu_prog *prog, int i; int n; - if (array->has_compound_element) - return; - n = 0; for (i = 0; i < prog->n_stmts; ++i) { struct gpu_stmt *stmt = &prog->stmts[i]; @@ -74,8 +68,7 @@ static void collect_references(struct gpu_prog *prog, for (access = stmt->accesses; access; access = access->next) { const char *name; - name = isl_map_get_tuple_name(access->access, - isl_dim_out); + name = get_outer_array_name(access->access); if (name && !strcmp(array->name, name)) n++; } @@ -92,8 +85,7 @@ static void collect_references(struct gpu_prog *prog, for (access = stmt->accesses; access; access = access->next) { const char *name; - name = isl_map_get_tuple_name(access->access, - isl_dim_out); + name = get_outer_array_name(access->access); if (!name || strcmp(array->name, name)) continue; -- 2.11.4.GIT