Commit a5efada7 by Richard Guenther Committed by Richard Biener

tree-dfa.c (make_rename_temp): Be forgiving if not in SSA form.

2012-05-14  Richard Guenther  <rguenther@suse.de>

	* tree-dfa.c (make_rename_temp): Be forgiving if not in SSA form.
	* omp-low.c (expand_omp_taskreg): Properly conditionalize call
	to update_ssa.
	(expand_omp_for): Likewise.
	(expand_omp_for_generic): Adjust conditional add to referenced vars.
	Use make_rename_temp for temporaries that should be rewritten into
	SSA form.
	(expand_omp_for_static_nochunk): Likewise.
	(expand_omp_atomic_pipeline): Likewise.

From-SVN: r187467
parent a82960aa
2012-05-14 Richard Guenther <rguenther@suse.de> 2012-05-14 Richard Guenther <rguenther@suse.de>
* tree-dfa.c (make_rename_temp): Be forgiving if not in SSA form.
* omp-low.c (expand_omp_taskreg): Properly conditionalize call
to update_ssa.
(expand_omp_for): Likewise.
(expand_omp_for_generic): Adjust conditional add to referenced vars.
Use make_rename_temp for temporaries that should be rewritten into
SSA form.
(expand_omp_for_static_nochunk): Likewise.
(expand_omp_atomic_pipeline): Likewise.
2012-05-14 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53331 PR tree-optimization/53331
* tree-vect-data-refs.c (vect_verify_datarefs_alignment): Ignore * tree-vect-data-refs.c (vect_verify_datarefs_alignment): Ignore
strided loads. strided loads.
......
...@@ -3598,7 +3598,8 @@ expand_omp_taskreg (struct omp_region *region) ...@@ -3598,7 +3598,8 @@ expand_omp_taskreg (struct omp_region *region)
expand_parallel_call (region, new_bb, entry_stmt, ws_args); expand_parallel_call (region, new_bb, entry_stmt, ws_args);
else else
expand_task_call (new_bb, entry_stmt); expand_task_call (new_bb, entry_stmt);
update_ssa (TODO_update_ssa_only_virtuals); if (gimple_in_ssa_p (cfun))
update_ssa (TODO_update_ssa_only_virtuals);
} }
...@@ -3709,7 +3710,7 @@ expand_omp_for_generic (struct omp_region *region, ...@@ -3709,7 +3710,7 @@ expand_omp_for_generic (struct omp_region *region,
iend0 = create_tmp_var (fd->iter_type, ".iend0"); iend0 = create_tmp_var (fd->iter_type, ".iend0");
TREE_ADDRESSABLE (istart0) = 1; TREE_ADDRESSABLE (istart0) = 1;
TREE_ADDRESSABLE (iend0) = 1; TREE_ADDRESSABLE (iend0) = 1;
if (gimple_in_ssa_p (cfun)) if (gimple_referenced_vars (cfun))
{ {
add_referenced_var (istart0); add_referenced_var (istart0);
add_referenced_var (iend0); add_referenced_var (iend0);
...@@ -3793,7 +3794,7 @@ expand_omp_for_generic (struct omp_region *region, ...@@ -3793,7 +3794,7 @@ expand_omp_for_generic (struct omp_region *region,
counts[i] = t; counts[i] = t;
else else
{ {
counts[i] = create_tmp_var (type, ".count"); counts[i] = make_rename_temp (type, ".count");
t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE, t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
true, GSI_SAME_STMT); true, GSI_SAME_STMT);
stmt = gimple_build_assign (counts[i], t); stmt = gimple_build_assign (counts[i], t);
...@@ -3918,8 +3919,7 @@ expand_omp_for_generic (struct omp_region *region, ...@@ -3918,8 +3919,7 @@ expand_omp_for_generic (struct omp_region *region,
false, GSI_CONTINUE_LINKING); false, GSI_CONTINUE_LINKING);
if (fd->collapse > 1) if (fd->collapse > 1)
{ {
tree tem = create_tmp_var (type, ".tem"); tree tem = make_rename_temp (type, ".tem");
stmt = gimple_build_assign (tem, fd->loop.v); stmt = gimple_build_assign (tem, fd->loop.v);
gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING); gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
for (i = fd->collapse - 1; i >= 0; i--) for (i = fd->collapse - 1; i >= 0; i--)
...@@ -4207,12 +4207,12 @@ expand_omp_for_static_nochunk (struct omp_region *region, ...@@ -4207,12 +4207,12 @@ expand_omp_for_static_nochunk (struct omp_region *region,
t = fold_convert (itype, t); t = fold_convert (itype, t);
n = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT); n = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT);
q = create_tmp_var (itype, "q"); q = make_rename_temp (itype, "q");
t = fold_build2 (TRUNC_DIV_EXPR, itype, n, nthreads); t = fold_build2 (TRUNC_DIV_EXPR, itype, n, nthreads);
t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE, true, GSI_SAME_STMT); t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE, true, GSI_SAME_STMT);
gsi_insert_before (&gsi, gimple_build_assign (q, t), GSI_SAME_STMT); gsi_insert_before (&gsi, gimple_build_assign (q, t), GSI_SAME_STMT);
tt = create_tmp_var (itype, "tt"); tt = make_rename_temp (itype, "tt");
t = fold_build2 (TRUNC_MOD_EXPR, itype, n, nthreads); t = fold_build2 (TRUNC_MOD_EXPR, itype, n, nthreads);
t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE, true, GSI_SAME_STMT); t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE, true, GSI_SAME_STMT);
gsi_insert_before (&gsi, gimple_build_assign (tt, t), GSI_SAME_STMT); gsi_insert_before (&gsi, gimple_build_assign (tt, t), GSI_SAME_STMT);
...@@ -4433,7 +4433,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd) ...@@ -4433,7 +4433,7 @@ expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
n = force_gimple_operand_gsi (&si, t, true, NULL_TREE, n = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
true, GSI_SAME_STMT); true, GSI_SAME_STMT);
trip_var = create_tmp_var (itype, ".trip"); trip_var = create_tmp_reg (itype, ".trip");
if (gimple_in_ssa_p (cfun)) if (gimple_in_ssa_p (cfun))
{ {
add_referenced_var (trip_var); add_referenced_var (trip_var);
...@@ -4679,7 +4679,8 @@ expand_omp_for (struct omp_region *region) ...@@ -4679,7 +4679,8 @@ expand_omp_for (struct omp_region *region)
(enum built_in_function) next_ix); (enum built_in_function) next_ix);
} }
update_ssa (TODO_update_ssa_only_virtuals); if (gimple_in_ssa_p (cfun))
update_ssa (TODO_update_ssa_only_virtuals);
} }
...@@ -5281,8 +5282,8 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb, ...@@ -5281,8 +5282,8 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
{ {
tree iaddr_val; tree iaddr_val;
iaddr = create_tmp_var (build_pointer_type_for_mode (itype, ptr_mode, iaddr = make_rename_temp (build_pointer_type_for_mode (itype, ptr_mode,
true), NULL); true), NULL);
iaddr_val iaddr_val
= force_gimple_operand_gsi (&si, = force_gimple_operand_gsi (&si,
fold_convert (TREE_TYPE (iaddr), addr), fold_convert (TREE_TYPE (iaddr), addr),
......
...@@ -198,10 +198,9 @@ make_rename_temp (tree type, const char *prefix) ...@@ -198,10 +198,9 @@ make_rename_temp (tree type, const char *prefix)
tree t = create_tmp_reg (type, prefix); tree t = create_tmp_reg (type, prefix);
if (gimple_referenced_vars (cfun)) if (gimple_referenced_vars (cfun))
{ add_referenced_var (t);
add_referenced_var (t); if (gimple_in_ssa_p (cfun))
mark_sym_for_renaming (t); mark_sym_for_renaming (t);
}
return t; return t;
} }
......
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