diff options
Diffstat (limited to 'gcc/graphite-scop-detection.c')
-rw-r--r-- | gcc/graphite-scop-detection.c | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index a8963e1dd81..c236556522a 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1103,7 +1103,7 @@ scop_detection::stmt_simple_for_scop_p (sese_l scop, gimple *stmt, tree op = gimple_op (stmt, i); if (!graphite_can_represent_expr (scop, loop, op) /* We can only constrain on integer type. */ - || (TREE_CODE (TREE_TYPE (op)) != INTEGER_TYPE)) + || ! INTEGRAL_TYPE_P (TREE_TYPE (op))) { DEBUG_PRINT (dp << "[scop-detection-fail] " << "Graphite cannot represent stmt:\n"; @@ -1146,49 +1146,23 @@ scop_detection::nb_pbbs_in_loops (scop_p scop) return res; } -/* When parameter NAME is in REGION, returns its index in SESE_PARAMS. - Otherwise returns -1. */ +/* Assigns the parameter NAME an index in REGION. */ -static inline int -parameter_index_in_region_1 (tree name, sese_info_p region) +static void +assign_parameter_index_in_region (tree name, sese_info_p region) { + gcc_assert (TREE_CODE (name) == SSA_NAME + && INTEGRAL_TYPE_P (TREE_TYPE (name)) + && ! defined_in_sese_p (name, region->region)); + int i; tree p; - - gcc_assert (TREE_CODE (name) == SSA_NAME); - FOR_EACH_VEC_ELT (region->params, i, p) if (p == name) - return i; - - return -1; -} - -/* When the parameter NAME is in REGION, returns its index in - SESE_PARAMS. Otherwise this function inserts NAME in SESE_PARAMS - and returns the index of NAME. */ - -static int -parameter_index_in_region (tree name, sese_info_p region) -{ - int i; - - gcc_assert (TREE_CODE (name) == SSA_NAME); - - /* Cannot constrain on anything else than INTEGER_TYPE parameters. */ - if (TREE_CODE (TREE_TYPE (name)) != INTEGER_TYPE) - return -1; - - if (!invariant_in_sese_p_rec (name, region->region, NULL)) - return -1; - - i = parameter_index_in_region_1 (name, region); - if (i != -1) - return i; + return; i = region->params.length (); region->params.safe_push (name); - return i; } /* In the context of sese S, scan the expression E and translate it to @@ -1230,7 +1204,7 @@ scan_tree_for_params (sese_info_p s, tree e) break; case SSA_NAME: - parameter_index_in_region (e, s); + assign_parameter_index_in_region (e, s); break; case INTEGER_CST: |