summaryrefslogtreecommitdiff
path: root/gcc/graphite-sese-to-poly.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/graphite-sese-to-poly.c')
-rw-r--r--gcc/graphite-sese-to-poly.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 4a2ca40ba13..cdabd738dc6 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -87,8 +87,7 @@ remove_invariant_phi (sese region, gimple_stmt_iterator *psi)
edge e = gimple_phi_arg_edge (phi, entry);
tree var;
gimple stmt;
- gimple_seq stmts;
- gimple_stmt_iterator gsi;
+ gimple_seq stmts = NULL;
if (tree_contains_chrecs (scev, NULL))
scev = gimple_phi_arg_def (phi, entry);
@@ -97,11 +96,7 @@ remove_invariant_phi (sese region, gimple_stmt_iterator *psi)
stmt = gimple_build_assign (res, var);
remove_phi_node (psi, false);
- if (!stmts)
- stmts = gimple_seq_alloc ();
-
- gsi = gsi_last (stmts);
- gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
+ gimple_seq_add_stmt (&stmts, stmt);
gsi_insert_seq_on_edge (e, stmts);
gsi_commit_edge_inserts ();
SSA_NAME_DEF_STMT (res) = stmt;
@@ -2088,11 +2083,7 @@ insert_stmts (scop_p scop, gimple stmt, gimple_seq stmts,
gimple_stmt_iterator gsi;
VEC (gimple, heap) *x = VEC_alloc (gimple, heap, 3);
- if (!stmts)
- stmts = gimple_seq_alloc ();
-
- gsi = gsi_last (stmts);
- gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
+ gimple_seq_add_stmt (&stmts, stmt);
for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi))
VEC_safe_push (gimple, heap, x, gsi_stmt (gsi));
@@ -2107,16 +2098,12 @@ static void
insert_out_of_ssa_copy (scop_p scop, tree res, tree expr, gimple after_stmt)
{
gimple_seq stmts;
- gimple_stmt_iterator si;
gimple_stmt_iterator gsi;
tree var = force_gimple_operand (expr, &stmts, true, NULL_TREE);
gimple stmt = gimple_build_assign (res, var);
VEC (gimple, heap) *x = VEC_alloc (gimple, heap, 3);
- if (!stmts)
- stmts = gimple_seq_alloc ();
- si = gsi_last (stmts);
- gsi_insert_after (&si, stmt, GSI_NEW_STMT);
+ gimple_seq_add_stmt (&stmts, stmt);
for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi))
VEC_safe_push (gimple, heap, x, gsi_stmt (gsi));
@@ -2167,17 +2154,13 @@ static void
insert_out_of_ssa_copy_on_edge (scop_p scop, edge e, tree res, tree expr)
{
gimple_stmt_iterator gsi;
- gimple_seq stmts;
+ gimple_seq stmts = NULL;
tree var = force_gimple_operand (expr, &stmts, true, NULL_TREE);
gimple stmt = gimple_build_assign (res, var);
basic_block bb;
VEC (gimple, heap) *x = VEC_alloc (gimple, heap, 3);
- if (!stmts)
- stmts = gimple_seq_alloc ();
-
- gsi = gsi_last (stmts);
- gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
+ gimple_seq_add_stmt (&stmts, stmt);
for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi))
VEC_safe_push (gimple, heap, x, gsi_stmt (gsi));