Commit 2a86de57 by Richard Biener

fold-const.c (fold_ternary_loc): Also fold non-constant vector CONSTRUCTORs.

2011-10-06  Richard Guenther  <rguenther@suse.de>

	* fold-const.c (fold_ternary_loc): Also fold non-constant
	vector CONSTRUCTORs.  Make more efficient.
	* tree-ssa-dom.c (cprop_operand): Don't handle virtual operands.
	(cprop_into_stmt): Don't propagate into virtual operands.
	(optimize_stmt): Really dump original statement.

From-SVN: r179598
parent 69c2fbf1
...@@ -1995,17 +1995,6 @@ cprop_operand (gimple stmt, use_operand_p op_p) ...@@ -1995,17 +1995,6 @@ cprop_operand (gimple stmt, use_operand_p op_p)
val = SSA_NAME_VALUE (op); val = SSA_NAME_VALUE (op);
if (val && val != op) if (val && val != op)
{ {
/* Do not change the base variable in the virtual operand
tables. That would make it impossible to reconstruct
the renamed virtual operand if we later modify this
statement. Also only allow the new value to be an SSA_NAME
for propagation into virtual operands. */
if (!is_gimple_reg (op)
&& (TREE_CODE (val) != SSA_NAME
|| is_gimple_reg (val)
|| get_virtual_var (val) != get_virtual_var (op)))
return;
/* Do not replace hard register operands in asm statements. */ /* Do not replace hard register operands in asm statements. */
if (gimple_code (stmt) == GIMPLE_ASM if (gimple_code (stmt) == GIMPLE_ASM
&& !may_propagate_copy_into_asm (op)) && !may_propagate_copy_into_asm (op))
...@@ -2076,11 +2065,8 @@ cprop_into_stmt (gimple stmt) ...@@ -2076,11 +2065,8 @@ cprop_into_stmt (gimple stmt)
use_operand_p op_p; use_operand_p op_p;
ssa_op_iter iter; ssa_op_iter iter;
FOR_EACH_SSA_USE_OPERAND (op_p, stmt, iter, SSA_OP_ALL_USES) FOR_EACH_SSA_USE_OPERAND (op_p, stmt, iter, SSA_OP_USE)
{ cprop_operand (stmt, op_p);
if (TREE_CODE (USE_FROM_PTR (op_p)) == SSA_NAME)
cprop_operand (stmt, op_p);
}
} }
/* Optimize the statement pointed to by iterator SI. /* Optimize the statement pointed to by iterator SI.
...@@ -2107,18 +2093,18 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si) ...@@ -2107,18 +2093,18 @@ optimize_stmt (basic_block bb, gimple_stmt_iterator si)
old_stmt = stmt = gsi_stmt (si); old_stmt = stmt = gsi_stmt (si);
if (gimple_code (stmt) == GIMPLE_COND)
canonicalize_comparison (stmt);
update_stmt_if_modified (stmt);
opt_stats.num_stmts++;
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
{ {
fprintf (dump_file, "Optimizing statement "); fprintf (dump_file, "Optimizing statement ");
print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
} }
if (gimple_code (stmt) == GIMPLE_COND)
canonicalize_comparison (stmt);
update_stmt_if_modified (stmt);
opt_stats.num_stmts++;
/* Const/copy propagate into USES, VUSES and the RHS of VDEFs. */ /* Const/copy propagate into USES, VUSES and the RHS of VDEFs. */
cprop_into_stmt (stmt); cprop_into_stmt (stmt);
......
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