Commit f74c4b2c by Richard Biener Committed by Richard Biener

re PR tree-optimization/93199 (Compile time hog in sink_clobbers)

2019-01-08  Richard Biener  <rguenther@suse.de>

	PR middle-end/93199
	c/
	* gimple-parser.c (c_parser_parse_gimple_body): Remove __PHI IFN
	permanently.

	* gimple-fold.c (rewrite_to_defined_overflow): Mark stmt modified.
	* tree-ssa-loop-im.c (move_computations_worker): Properly adjust
	virtual operand, also updating SSA use.
	* gimple-loop-interchange.cc (loop_cand::undo_simple_reduction):
	Update stmt after resetting virtual operand.
	(tree_loop_interchange::move_code_to_inner_loop): Likewise.

	* gimple-iterator.c (gsi_remove): When not removing the stmt
	permanently do not delink immediate uses or mark the stmt modified.

From-SVN: r280000
parent d597b944
2019-01-08 Richard Biener <rguenther@suse.de>
PR middle-end/93199
* gimple-fold.c (rewrite_to_defined_overflow): Mark stmt modified.
* tree-ssa-loop-im.c (move_computations_worker): Properly adjust
virtual operand, also updating SSA use.
* gimple-loop-interchange.cc (loop_cand::undo_simple_reduction):
Update stmt after resetting virtual operand.
(tree_loop_interchange::move_code_to_inner_loop): Likewise.
* gimple-iterator.c (gsi_remove): When not removing the stmt
permanently do not delink immediate uses or mark the stmt modified.
2020-01-08 Martin Liska <mliska@suse.cz> 2020-01-08 Martin Liska <mliska@suse.cz>
* ipa-fnsummary.c (dump_ipa_call_summary): Use symtab_node::dump_name. * ipa-fnsummary.c (dump_ipa_call_summary): Use symtab_node::dump_name.
......
2019-01-08 Richard Biener <rguenther@suse.de>
PR middle-end/93199
* gimple-parser.c (c_parser_parse_gimple_body): Remove __PHI IFN
permanently.
2020-01-01 Jakub Jelinek <jakub@redhat.com> 2020-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years. Update copyright years.
......
...@@ -327,7 +327,7 @@ c_parser_parse_gimple_body (c_parser *cparser, char *gimple_pass, ...@@ -327,7 +327,7 @@ c_parser_parse_gimple_body (c_parser *cparser, char *gimple_pass,
add_phi_arg (phi, gimple_call_arg (stmt, i + 1), e, add_phi_arg (phi, gimple_call_arg (stmt, i + 1), e,
UNKNOWN_LOCATION); UNKNOWN_LOCATION);
} }
gsi_remove (&gsi, false); gsi_remove (&gsi, true);
} }
/* Fill SSA name gaps, putting them on the freelist. */ /* Fill SSA name gaps, putting them on the freelist. */
for (unsigned i = 1; i < num_ssa_names; ++i) for (unsigned i = 1; i < num_ssa_names; ++i)
......
...@@ -7380,6 +7380,7 @@ rewrite_to_defined_overflow (gimple *stmt) ...@@ -7380,6 +7380,7 @@ rewrite_to_defined_overflow (gimple *stmt)
gimple_assign_set_lhs (stmt, make_ssa_name (type, stmt)); gimple_assign_set_lhs (stmt, make_ssa_name (type, stmt));
if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR) if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
gimple_assign_set_rhs_code (stmt, PLUS_EXPR); gimple_assign_set_rhs_code (stmt, PLUS_EXPR);
gimple_set_modified (stmt, true);
gimple_seq_add_stmt (&stmts, stmt); gimple_seq_add_stmt (&stmts, stmt);
gimple *cvt = gimple_build_assign (lhs, NOP_EXPR, gimple_assign_lhs (stmt)); gimple *cvt = gimple_build_assign (lhs, NOP_EXPR, gimple_assign_lhs (stmt));
gimple_seq_add_stmt (&stmts, cvt); gimple_seq_add_stmt (&stmts, cvt);
......
...@@ -558,16 +558,18 @@ gsi_remove (gimple_stmt_iterator *i, bool remove_permanently) ...@@ -558,16 +558,18 @@ gsi_remove (gimple_stmt_iterator *i, bool remove_permanently)
gimple *stmt = gsi_stmt (*i); gimple *stmt = gsi_stmt (*i);
bool require_eh_edge_purge = false; bool require_eh_edge_purge = false;
/* ??? Do we want to do this for non-permanent operation? */
if (gimple_code (stmt) != GIMPLE_PHI) if (gimple_code (stmt) != GIMPLE_PHI)
insert_debug_temps_for_defs (i); insert_debug_temps_for_defs (i);
/* Free all the data flow information for STMT. */
gimple_set_bb (stmt, NULL); gimple_set_bb (stmt, NULL);
delink_stmt_imm_use (stmt);
gimple_set_modified (stmt, true);
if (remove_permanently) if (remove_permanently)
{ {
/* Free all the data flow information for STMT. */
delink_stmt_imm_use (stmt);
gimple_set_modified (stmt, true);
if (gimple_debug_nonbind_marker_p (stmt)) if (gimple_debug_nonbind_marker_p (stmt))
/* We don't need this to be exact, but try to keep it at least /* We don't need this to be exact, but try to keep it at least
close. */ close. */
......
...@@ -879,6 +879,7 @@ loop_cand::undo_simple_reduction (reduction_p re, bitmap dce_seeds) ...@@ -879,6 +879,7 @@ loop_cand::undo_simple_reduction (reduction_p re, bitmap dce_seeds)
if (re->producer != NULL) if (re->producer != NULL)
{ {
gimple_set_vuse (re->producer, NULL_TREE); gimple_set_vuse (re->producer, NULL_TREE);
update_stmt (re->producer);
from = gsi_for_stmt (re->producer); from = gsi_for_stmt (re->producer);
gsi_remove (&from, false); gsi_remove (&from, false);
gimple_seq_add_stmt_without_update (&stmts, re->producer); gimple_seq_add_stmt_without_update (&stmts, re->producer);
...@@ -920,6 +921,7 @@ loop_cand::undo_simple_reduction (reduction_p re, bitmap dce_seeds) ...@@ -920,6 +921,7 @@ loop_cand::undo_simple_reduction (reduction_p re, bitmap dce_seeds)
gimple_set_vdef (re->consumer, NULL_TREE); gimple_set_vdef (re->consumer, NULL_TREE);
gimple_set_vuse (re->consumer, NULL_TREE); gimple_set_vuse (re->consumer, NULL_TREE);
gimple_assign_set_rhs1 (re->consumer, re->next); gimple_assign_set_rhs1 (re->consumer, re->next);
update_stmt (re->consumer);
from = gsi_for_stmt (re->consumer); from = gsi_for_stmt (re->consumer);
to = gsi_for_stmt (SSA_NAME_DEF_STMT (re->next)); to = gsi_for_stmt (SSA_NAME_DEF_STMT (re->next));
gsi_move_after (&from, &to); gsi_move_after (&from, &to);
...@@ -1248,14 +1250,17 @@ tree_loop_interchange::move_code_to_inner_loop (class loop *outer, ...@@ -1248,14 +1250,17 @@ tree_loop_interchange::move_code_to_inner_loop (class loop *outer,
continue; continue;
} }
if (gimple_vuse (stmt))
gimple_set_vuse (stmt, NULL_TREE);
if (gimple_vdef (stmt)) if (gimple_vdef (stmt))
{ {
unlink_stmt_vdef (stmt); unlink_stmt_vdef (stmt);
release_ssa_name (gimple_vdef (stmt)); release_ssa_name (gimple_vdef (stmt));
gimple_set_vdef (stmt, NULL_TREE); gimple_set_vdef (stmt, NULL_TREE);
} }
if (gimple_vuse (stmt))
{
gimple_set_vuse (stmt, NULL_TREE);
update_stmt (stmt);
}
reset_debug_uses (stmt); reset_debug_uses (stmt);
gsi_move_before (&gsi, &to); gsi_move_before (&gsi, &to);
......
...@@ -1231,7 +1231,8 @@ move_computations_worker (basic_block bb) ...@@ -1231,7 +1231,8 @@ move_computations_worker (basic_block bb)
gphi *phi = gsi2.phi (); gphi *phi = gsi2.phi ();
if (virtual_operand_p (gimple_phi_result (phi))) if (virtual_operand_p (gimple_phi_result (phi)))
{ {
gimple_set_vuse (stmt, PHI_ARG_DEF_FROM_EDGE (phi, e)); SET_USE (gimple_vuse_op (stmt),
PHI_ARG_DEF_FROM_EDGE (phi, e));
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment