From bd7742f8ef1cbac617b6f58fe28b4bb2dcaa584c Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Mon, 8 Mar 2010 17:48:48 +0000 Subject: [PATCH] graphite-clast-to-gimple.c (find_cloog_iv_in_expr): Simplify and clean up the logic. Cleanup. 2010-02-23 Sebastian Pop * graphite-clast-to-gimple.c (find_cloog_iv_in_expr): Simplify and clean up the logic. From-SVN: r157279 --- gcc/ChangeLog.graphite | 5 +++++ gcc/graphite-clast-to-gimple.c | 30 +++++++++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index a3dbd5fac05..e3e6ecdd106 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,3 +1,8 @@ +2010-02-23 Sebastian Pop + + * graphite-clast-to-gimple.c (find_cloog_iv_in_expr): Simplify + and clean up the logic. + 2010-02-23 Sebastian Pop * graphite-sese-to-poly.c (add_param_constraints): Enabled: remove diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c index 424f5c68169..3e82075f2bc 100644 --- a/gcc/graphite-clast-to-gimple.c +++ b/gcc/graphite-clast-to-gimple.c @@ -997,34 +997,30 @@ static const char * find_cloog_iv_in_expr (struct clast_expr *expr) { struct clast_term *term = (struct clast_term *) expr; - - if (expr->type == expr_term - && !term->var) - return NULL; + struct clast_reduction *red; + int i; if (expr->type == expr_term) return term->var; - if (expr->type == expr_red) + if (expr->type != expr_red) + return NULL; + + red = (struct clast_reduction *) expr; + for (i = 0; i < red->n; i++) { - int i; - struct clast_reduction *red = (struct clast_reduction *) expr; + const char *res = find_cloog_iv_in_expr (red->elts[i]); - for (i = 0; i < red->n; i++) - { - const char *res = find_cloog_iv_in_expr ((red)->elts[i]); - - if (res) - return res; - } + if (res) + return res; } return NULL; } -/* Build for a clast_user_stmt USER_STMT a map between the CLAST - induction variables and the corresponding GCC old induction - variables. This information is stored on each GRAPHITE_BB. */ +/* Build for USER_STMT a map between the CLAST induction variables and + the corresponding GCC old induction variables. This information is + stored on each GRAPHITE_BB. */ static void compute_cloog_iv_types_1 (poly_bb_p pbb, struct clast_user_stmt *user_stmt)