diff options
author | Aditya Kumar <aditya.k7@samsung.com> | 2015-10-21 18:53:35 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2015-10-21 18:53:35 +0000 |
commit | 77ec8b8c0f75a5f0b953e5dd6696e6b07253f21b (patch) | |
tree | e9fe19bfcb75c2f7c755a5ac577e0861c0c15e1c /gcc | |
parent | caf5b4dfca050e8e93b1ee15705ab9c759854f40 (diff) | |
download | gcc-77ec8b8c0f75a5f0b953e5dd6696e6b07253f21b.zip gcc-77ec8b8c0f75a5f0b953e5dd6696e6b07253f21b.tar.gz gcc-77ec8b8c0f75a5f0b953e5dd6696e6b07253f21b.tar.bz2 |
avoid generation of empty guards in trivial cases
We used to insert a trivial integer_onep condition around loops we know have
more than an iteration. This patch avoids generating those conditions.
* graphite-isl-ast-to-gimple.c (graphite_create_new_loop_guard): Do not call
create_empty_if_region_on_edge when cond_expr is true.
(translate_isl_ast_node_for): Check whether a guard has been generated.
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r229137
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/graphite-isl-ast-to-gimple.c | 15 |
2 files changed, 18 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8b4735d..1bad16d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,11 @@ 2015-10-21 Aditya Kumar <aditya.k7@samsung.com> + Sebastian Pop <s.pop@samsung.com> + + * graphite-isl-ast-to-gimple.c (graphite_create_new_loop_guard): Do not call + create_empty_if_region_on_edge when cond_expr is true. + (translate_isl_ast_node_for): Check whether a guard has been generated. + +2015-10-21 Aditya Kumar <aditya.k7@samsung.com> * graphite-poly.h (struct dr_info): Added invalid_alias_set number. (operator=): Removed. diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index 7f99bce..de28477 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -707,7 +707,10 @@ graphite_create_new_loop_guard (edge entry_edge, cond_expr = fold_build2 (LT_EXPR, boolean_type_node, *lb, ub_one); } - exit_edge = create_empty_if_region_on_edge (entry_edge, cond_expr); + if (integer_onep (cond_expr)) + exit_edge = entry_edge; + else + exit_edge = create_empty_if_region_on_edge (entry_edge, cond_expr); return exit_edge; } @@ -723,10 +726,14 @@ translate_isl_ast_node_for (loop_p context_loop, __isl_keep isl_ast_node *node, tree type, lb, ub; edge last_e = graphite_create_new_loop_guard (next_e, node, &type, &lb, &ub, ip); - edge true_e = get_true_edge_from_guard_bb (next_e->dest); - translate_isl_ast_for_loop (context_loop, node, true_e, - type, lb, ub, ip); + if (last_e == next_e) + /* There was no guard generated. */ + return translate_isl_ast_for_loop (context_loop, node, last_e, + type, lb, ub, ip); + + edge true_e = get_true_edge_from_guard_bb (next_e->dest); + translate_isl_ast_for_loop (context_loop, node, true_e, type, lb, ub, ip); return last_e; } |