Commit bd8d431f by Richard Biener Committed by Richard Biener

graphite-isl-ast-to-gimple.c: Include ssa.h and tree-ssa.h.

2017-10-06  Richard Biener  <rguenther@suse.de>

	* graphite-isl-ast-to-gimple.c: Include ssa.h and tree-ssa.h.
	(translate_isl_ast_to_gimple::translate_pending_phi_nodes,
	translate_isl_ast_to_gimple::is_valid_rename,
	translate_isl_ast_to_gimple::get_rename,
	translate_isl_ast_to_gimple::get_def_bb_for_const,
	translate_isl_ast_to_gimple::get_new_name,
	translate_isl_ast_to_gimple::collect_all_ssa_names,
	translate_isl_ast_to_gimple::copy_loop_phi_args,
	translate_isl_ast_to_gimple::collect_all_ssa_names,
	translate_isl_ast_to_gimple::copy_loop_phi_args,
	translate_isl_ast_to_gimple::copy_loop_phi_nodes,
	translate_isl_ast_to_gimple::add_close_phis_to_merge_points,
	translate_isl_ast_to_gimple::add_close_phis_to_outer_loops,
	translate_isl_ast_to_gimple::copy_loop_close_phi_args,
	translate_isl_ast_to_gimple::copy_loop_close_phi_nodes,
	translate_isl_ast_to_gimple::copy_cond_phi_args,
	translate_isl_ast_to_gimple::copy_cond_phi_nodes,
	translate_isl_ast_to_gimple::edge_for_new_close_phis,
	translate_isl_ast_to_gimple::add_phi_arg_for_new_expr,
	translate_isl_ast_to_gimple::rename_uses,
	translate_isl_ast_to_gimple::rename_all_uses): Remove.
	(translate_isl_ast_to_gimple::get_rename_from_scev): Simplify.
	(set_rename_for_each_def): Likewise.
	(graphite_copy_stmts_from_block): Handle debug stmt resetting
	here.  Handle rewriting SCEV analyzable uses here.
	(copy_bb_and_scalar_dependences): Generate code for PHI
	copy-in/outs.
	(graphite_regenerate_ast_isl): Adjust.
	* graphite-scop-detection.c (trivially_empty_bb_p): Move to sese.[ch].
	(add_write, add_read): New functions.
	(build_cross_bb_scalars_def): Use it and simplify.
	(build_cross_bb_scalars_use): Likewise.
	(graphite_find_cross_bb_scalar_vars): Inline into...
	(try_generate_gimple_bb): ...here.  Add dependences for PHIs,
	simulating out-of-SSA.  Compute liveout and add dependencies.
	(build_scops): Force an empty entry block.
	* sese.h (sese_info_t::liveout, sese_info_t::debug_liveout): New
	members.
	(sese_build_liveouts): Declare.
	(sese_trivially_empty_bb_p): Likewise.
	* sese.c (sese_build_liveouts_bb): Properly handle PHIs,
	compute liveout and debug_liveout.
	(sese_bad_liveouts_use): Remove.
	(sese_reset_debug_liveouts_bb): Likewise.
	(sese_reset_debug_liveouts): Rewrite in terms of debug_liveout.
	(sese_build_liveouts): Build liveout and debug_liveout and store
	it in region.
	(new_sese_info): Adjust.
	(free_sese_info): Likewise.
	(sese_insert_phis_for_liveouts): Reset debug stmts from here,
	do not build liveout here.
	(move_sese_in_condition): Adjust region entry.
	(scev_analyzable_p): Match up with chrec_apply requirements.
	(sese_trivially_empty_bb_p): New.
	* tree-into-ssa.c (get_reaching_def): Properly support generating
	default-defs for incremental rewrite of anonymous names.

	* gcc.dg/graphite/id-15.c: No longer expect a code generation error.
	* gcc.dg/graphite/id-16.c: Likewise.
	* gcc.dg/graphite/pr46168.c: Likewise.
	* gcc.dg/graphite/pr68756.c: Likewise.
	* gcc.dg/graphite/pr69728.c: Likewise.
	* gcc.dg/graphite/pr71575-2.c: Likewise.
	* gcc.dg/graphite/pr77362.c: Likewise.
	* gcc.dg/graphite/pr81373.c: Likewise.
	* gcc.dg/graphite/run-id-pr67700-1.c: Likewise.
	* gfortran.dg/graphite/interchange-1.f: Likewise.
	* gfortran.dg/graphite/pr42334-1.f: Likewise.
	* gfortran.dg/graphite/pr42393-1.f90: Likewise.
	* gfortran.dg/graphite/pr42393.f90: Likewise.
	* gfortran.dg/graphite/pr47019.f: Likewise.
	* gfortran.dg/graphite/id-17.f: Likewise.
	* gfortran.dg/graphite/id-19.f: Likewise.
	* gfortran.dg/graphite/run-id-2.f90: Likewise.
	* gfortran.dg/graphite/pr42326-1.f90: Likewise.
	* gfortran.dg/graphite/pr42326.f90: Likewise.
	* gfortran.dg/graphite/pr68550-2.f90: Likewise.
	* gfortran.dg/graphite/pr29581.f90: Likewise.  No longer expect
	a code generation error.
	* gfortran.dg/graphite/run-id-3.f90: Likewise.
	* gfortran.dg/graphite/pr29832.f90: Likewise.

From-SVN: r253475
parent 57cfa172
2017-10-06 Richard Biener <rguenther@suse.de> 2017-10-06 Richard Biener <rguenther@suse.de>
* graphite-isl-ast-to-gimple.c: Include ssa.h and tree-ssa.h.
(translate_isl_ast_to_gimple::translate_pending_phi_nodes,
translate_isl_ast_to_gimple::is_valid_rename,
translate_isl_ast_to_gimple::get_rename,
translate_isl_ast_to_gimple::get_def_bb_for_const,
translate_isl_ast_to_gimple::get_new_name,
translate_isl_ast_to_gimple::collect_all_ssa_names,
translate_isl_ast_to_gimple::copy_loop_phi_args,
translate_isl_ast_to_gimple::collect_all_ssa_names,
translate_isl_ast_to_gimple::copy_loop_phi_args,
translate_isl_ast_to_gimple::copy_loop_phi_nodes,
translate_isl_ast_to_gimple::add_close_phis_to_merge_points,
translate_isl_ast_to_gimple::add_close_phis_to_outer_loops,
translate_isl_ast_to_gimple::copy_loop_close_phi_args,
translate_isl_ast_to_gimple::copy_loop_close_phi_nodes,
translate_isl_ast_to_gimple::copy_cond_phi_args,
translate_isl_ast_to_gimple::copy_cond_phi_nodes,
translate_isl_ast_to_gimple::edge_for_new_close_phis,
translate_isl_ast_to_gimple::add_phi_arg_for_new_expr,
translate_isl_ast_to_gimple::rename_uses,
translate_isl_ast_to_gimple::rename_all_uses): Remove.
(translate_isl_ast_to_gimple::get_rename_from_scev): Simplify.
(set_rename_for_each_def): Likewise.
(graphite_copy_stmts_from_block): Handle debug stmt resetting
here. Handle rewriting SCEV analyzable uses here.
(copy_bb_and_scalar_dependences): Generate code for PHI
copy-in/outs.
(graphite_regenerate_ast_isl): Adjust.
* graphite-scop-detection.c (trivially_empty_bb_p): Move to sese.[ch].
(add_write, add_read): New functions.
(build_cross_bb_scalars_def): Use it and simplify.
(build_cross_bb_scalars_use): Likewise.
(graphite_find_cross_bb_scalar_vars): Inline into...
(try_generate_gimple_bb): ...here. Add dependences for PHIs,
simulating out-of-SSA. Compute liveout and add dependencies.
(build_scops): Force an empty entry block.
* sese.h (sese_info_t::liveout, sese_info_t::debug_liveout): New
members.
(sese_build_liveouts): Declare.
(sese_trivially_empty_bb_p): Likewise.
* sese.c (sese_build_liveouts_bb): Properly handle PHIs,
compute liveout and debug_liveout.
(sese_bad_liveouts_use): Remove.
(sese_reset_debug_liveouts_bb): Likewise.
(sese_reset_debug_liveouts): Rewrite in terms of debug_liveout.
(sese_build_liveouts): Build liveout and debug_liveout and store
it in region.
(new_sese_info): Adjust.
(free_sese_info): Likewise.
(sese_insert_phis_for_liveouts): Reset debug stmts from here,
do not build liveout here.
(move_sese_in_condition): Adjust region entry.
(scev_analyzable_p): Match up with chrec_apply requirements.
(sese_trivially_empty_bb_p): New.
* tree-into-ssa.c (get_reaching_def): Properly support generating
default-defs for incremental rewrite of anonymous names.
2017-10-06 Richard Biener <rguenther@suse.de>
* graphite-sese-to-poly.c (extract_affine): For casts increasing * graphite-sese-to-poly.c (extract_affine): For casts increasing
precision do not perform modulo reduction. precision do not perform modulo reduction.
...@@ -254,21 +254,6 @@ dot_cfg () ...@@ -254,21 +254,6 @@ dot_cfg ()
scops.release (); scops.release ();
} }
/* Return true if BB is empty, contains only DEBUG_INSNs. */
static bool
trivially_empty_bb_p (basic_block bb)
{
gimple_stmt_iterator gsi;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
if (gimple_code (gsi_stmt (gsi)) != GIMPLE_DEBUG
&& gimple_code (gsi_stmt (gsi)) != GIMPLE_LABEL)
return false;
return true;
}
/* Can all ivs be represented by a signed integer? /* Can all ivs be represented by a signed integer?
As isl might generate negative values in its expressions, signed loop ivs As isl might generate negative values in its expressions, signed loop ivs
are required in the backend. */ are required in the backend. */
...@@ -471,7 +456,7 @@ scop_detection::get_sese (loop_p loop) ...@@ -471,7 +456,7 @@ scop_detection::get_sese (loop_p loop)
canonicalize_loop_closed_ssa makes sure that is in proper shape. */ canonicalize_loop_closed_ssa makes sure that is in proper shape. */
if (! single_pred_p (scop_end->dest) if (! single_pred_p (scop_end->dest)
|| ! single_succ_p (scop_end->dest) || ! single_succ_p (scop_end->dest)
|| ! trivially_empty_bb_p (scop_end->dest)) || ! sese_trivially_empty_bb_p (scop_end->dest))
gcc_unreachable (); gcc_unreachable ();
scop_end = single_succ_edge (scop_end->dest); scop_end = single_succ_edge (scop_end->dest);
...@@ -1346,13 +1331,35 @@ find_scop_parameters (scop_p scop) ...@@ -1346,13 +1331,35 @@ find_scop_parameters (scop_p scop)
scop_set_nb_params (scop, nbp); scop_set_nb_params (scop, nbp);
} }
static void
add_write (vec<tree> *writes, tree def)
{
writes->safe_push (def);
DEBUG_PRINT (dp << "Adding scalar write: ";
print_generic_expr (dump_file, def);
dp << "\nFrom stmt: ";
print_gimple_stmt (dump_file,
SSA_NAME_DEF_STMT (def), 0));
}
static void
add_read (vec<scalar_use> *reads, tree use, gimple *use_stmt)
{
DEBUG_PRINT (dp << "Adding scalar read: ";
print_generic_expr (dump_file, use);
dp << "\nFrom stmt: ";
print_gimple_stmt (dump_file, use_stmt, 0));
reads->safe_push (std::make_pair (use_stmt, use));
}
/* Record DEF if it is used in other bbs different than DEF_BB in the SCOP. */ /* Record DEF if it is used in other bbs different than DEF_BB in the SCOP. */
static void static void
build_cross_bb_scalars_def (scop_p scop, tree def, basic_block def_bb, build_cross_bb_scalars_def (scop_p scop, tree def, basic_block def_bb,
vec<tree> *writes) vec<tree> *writes)
{ {
if (!def || !is_gimple_reg (def)) if (!is_gimple_reg (def))
return; return;
bool scev_analyzable = scev_analyzable_p (def, scop->scop_info->region); bool scev_analyzable = scev_analyzable_p (def, scop->scop_info->region);
...@@ -1366,16 +1373,9 @@ build_cross_bb_scalars_def (scop_p scop, tree def, basic_block def_bb, ...@@ -1366,16 +1373,9 @@ build_cross_bb_scalars_def (scop_p scop, tree def, basic_block def_bb,
/* But gather SESE liveouts as we otherwise fail to rewrite their /* But gather SESE liveouts as we otherwise fail to rewrite their
exit PHIs. */ exit PHIs. */
|| ! bb_in_sese_p (gimple_bb (use_stmt), scop->scop_info->region)) || ! bb_in_sese_p (gimple_bb (use_stmt), scop->scop_info->region))
&& ((def_bb != gimple_bb (use_stmt) && !is_gimple_debug (use_stmt)) && (def_bb != gimple_bb (use_stmt) && !is_gimple_debug (use_stmt)))
/* PHIs have their effect at "BBs" on the edges. See PR79622. */
|| gimple_code (SSA_NAME_DEF_STMT (def)) == GIMPLE_PHI))
{ {
writes->safe_push (def); add_write (writes, def);
DEBUG_PRINT (dp << "Adding scalar write: ";
print_generic_expr (dump_file, def);
dp << "\nFrom stmt: ";
print_gimple_stmt (dump_file,
SSA_NAME_DEF_STMT (def), 0));
/* This is required by the FOR_EACH_IMM_USE_STMT when we want to break /* This is required by the FOR_EACH_IMM_USE_STMT when we want to break
before all the uses have been visited. */ before all the uses have been visited. */
BREAK_FROM_IMM_USE_STMT (imm_iter); BREAK_FROM_IMM_USE_STMT (imm_iter);
...@@ -1389,7 +1389,6 @@ static void ...@@ -1389,7 +1389,6 @@ static void
build_cross_bb_scalars_use (scop_p scop, tree use, gimple *use_stmt, build_cross_bb_scalars_use (scop_p scop, tree use, gimple *use_stmt,
vec<scalar_use> *reads) vec<scalar_use> *reads)
{ {
gcc_assert (use);
if (!is_gimple_reg (use)) if (!is_gimple_reg (use))
return; return;
...@@ -1399,46 +1398,8 @@ build_cross_bb_scalars_use (scop_p scop, tree use, gimple *use_stmt, ...@@ -1399,46 +1398,8 @@ build_cross_bb_scalars_use (scop_p scop, tree use, gimple *use_stmt,
return; return;
gimple *def_stmt = SSA_NAME_DEF_STMT (use); gimple *def_stmt = SSA_NAME_DEF_STMT (use);
if (gimple_bb (def_stmt) != gimple_bb (use_stmt) if (gimple_bb (def_stmt) != gimple_bb (use_stmt))
/* PHIs have their effect at "BBs" on the edges. See PR79622. */ add_read (reads, use, use_stmt);
|| gimple_code (def_stmt) == GIMPLE_PHI)
{
DEBUG_PRINT (dp << "Adding scalar read: ";
print_generic_expr (dump_file, use);
dp << "\nFrom stmt: ";
print_gimple_stmt (dump_file, use_stmt, 0));
reads->safe_push (std::make_pair (use_stmt, use));
}
}
/* Record all scalar variables that are defined and used in different BBs of the
SCOP. */
static void
graphite_find_cross_bb_scalar_vars (scop_p scop, gimple *stmt,
vec<scalar_use> *reads, vec<tree> *writes)
{
tree def;
if (gimple_code (stmt) == GIMPLE_ASSIGN)
def = gimple_assign_lhs (stmt);
else if (gimple_code (stmt) == GIMPLE_CALL)
def = gimple_call_lhs (stmt);
else if (gimple_code (stmt) == GIMPLE_PHI)
def = gimple_phi_result (stmt);
else
return;
build_cross_bb_scalars_def (scop, def, gimple_bb (stmt), writes);
ssa_op_iter iter;
use_operand_p use_p;
FOR_EACH_PHI_OR_STMT_USE (use_p, stmt, iter, SSA_OP_USE)
{
tree use = USE_FROM_PTR (use_p);
build_cross_bb_scalars_use (scop, use, stmt, reads);
}
} }
/* Generates a polyhedral black box only if the bb contains interesting /* Generates a polyhedral black box only if the bb contains interesting
...@@ -1467,13 +1428,89 @@ try_generate_gimple_bb (scop_p scop, basic_block bb) ...@@ -1467,13 +1428,89 @@ try_generate_gimple_bb (scop_p scop, basic_block bb)
continue; continue;
graphite_find_data_references_in_stmt (nest, loop, stmt, &drs); graphite_find_data_references_in_stmt (nest, loop, stmt, &drs);
graphite_find_cross_bb_scalar_vars (scop, stmt, &reads, &writes);
tree def = gimple_get_lhs (stmt);
if (def)
build_cross_bb_scalars_def (scop, def, gimple_bb (stmt), &writes);
ssa_op_iter iter;
tree use;
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
build_cross_bb_scalars_use (scop, use, stmt, &reads);
} }
/* Handle defs and uses in PHIs. Those need special treatment given
that we have to present ISL with sth that looks like we've rewritten
the IL out-of-SSA. */
for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi); for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
gsi_next (&psi)) gsi_next (&psi))
if (!virtual_operand_p (gimple_phi_result (psi.phi ()))) {
graphite_find_cross_bb_scalar_vars (scop, psi.phi (), &reads, &writes); gphi *phi = psi.phi ();
tree res = gimple_phi_result (phi);
if (virtual_operand_p (res)
|| scev_analyzable_p (res, scop->scop_info->region))
continue;
/* To simulate out-of-SSA the block containing the PHI node has
reads of the PHI destination. And to preserve SSA dependences
we also write to it (the out-of-SSA decl and the SSA result
are coalesced for dependence purposes which is good enough). */
add_read (&reads, res, phi);
add_write (&writes, res);
}
basic_block bb_for_succs = bb;
if (bb_for_succs == bb_for_succs->loop_father->latch
&& bb_in_sese_p (bb_for_succs, scop->scop_info->region)
&& sese_trivially_empty_bb_p (bb_for_succs))
bb_for_succs = NULL;
while (bb_for_succs)
{
basic_block latch = NULL;
edge_iterator ei;
edge e;
FOR_EACH_EDGE (e, ei, bb_for_succs->succs)
{
for (gphi_iterator psi = gsi_start_phis (e->dest); !gsi_end_p (psi);
gsi_next (&psi))
{
gphi *phi = psi.phi ();
tree res = gimple_phi_result (phi);
if (virtual_operand_p (res))
continue;
/* To simulate out-of-SSA the predecessor of edges into PHI nodes
has a copy from the PHI argument to the PHI destination. */
if (! scev_analyzable_p (res, scop->scop_info->region))
add_write (&writes, res);
tree use = PHI_ARG_DEF_FROM_EDGE (phi, e);
if (TREE_CODE (use) == SSA_NAME
&& ! SSA_NAME_IS_DEFAULT_DEF (use)
&& gimple_bb (SSA_NAME_DEF_STMT (use)) != bb_for_succs
&& ! scev_analyzable_p (use, scop->scop_info->region))
add_read (&reads, use, phi);
}
if (e->dest == bb_for_succs->loop_father->latch
&& bb_in_sese_p (e->dest, scop->scop_info->region)
&& sese_trivially_empty_bb_p (e->dest))
latch = e->dest;
}
/* Handle empty latch block PHIs here, otherwise we confuse ISL
with extra conditional code where it then peels off the last
iteration just because of that. It would be simplest if we
just didn't force simple latches (thus remove the forwarder). */
bb_for_succs = latch;
}
/* For the region exit block add reads for all live-out vars. */
if (bb == scop->scop_info->region.exit->src)
{
sese_build_liveouts (scop->scop_info);
unsigned i;
bitmap_iterator bi;
EXECUTE_IF_SET_IN_BITMAP (scop->scop_info->liveout, 0, i, bi)
{
tree use = ssa_name (i);
add_read (&reads, use, NULL);
}
}
if (drs.is_empty () && writes.is_empty () && reads.is_empty ()) if (drs.is_empty () && writes.is_empty () && reads.is_empty ())
return NULL; return NULL;
...@@ -1700,6 +1737,10 @@ build_scops (vec<scop_p> *scops) ...@@ -1700,6 +1737,10 @@ build_scops (vec<scop_p> *scops)
sese_l *s; sese_l *s;
FOR_EACH_VEC_ELT (scops_l, i, s) FOR_EACH_VEC_ELT (scops_l, i, s)
{ {
/* For our out-of-SSA we need a block on s->entry, similar to how
we include the LCSSA block in the region. */
s->entry = single_pred_edge (split_edge (s->entry));
scop_p scop = new_scop (s->entry, s->exit); scop_p scop = new_scop (s->entry, s->exit);
/* Record all basic blocks and their conditions in REGION. */ /* Record all basic blocks and their conditions in REGION. */
......
...@@ -68,106 +68,80 @@ sese_build_liveouts_use (sese_info_p region, bitmap liveouts, basic_block bb, ...@@ -68,106 +68,80 @@ sese_build_liveouts_use (sese_info_p region, bitmap liveouts, basic_block bb,
used in BB that is outside of the REGION. */ used in BB that is outside of the REGION. */
static void static void
sese_build_liveouts_bb (sese_info_p region, bitmap liveouts, basic_block bb) sese_build_liveouts_bb (sese_info_p region, basic_block bb)
{ {
edge e;
edge_iterator ei;
ssa_op_iter iter; ssa_op_iter iter;
use_operand_p use_p; use_operand_p use_p;
FOR_EACH_EDGE (e, ei, bb->succs) for (gphi_iterator bsi = gsi_start_phis (bb); !gsi_end_p (bsi);
for (gphi_iterator bsi = gsi_start_phis (e->dest); !gsi_end_p (bsi); gsi_next (&bsi))
gsi_next (&bsi)) FOR_EACH_PHI_ARG (use_p, bsi.phi (), iter, SSA_OP_USE)
sese_build_liveouts_use (region, liveouts, bb, sese_build_liveouts_use (region, region->liveout,
PHI_ARG_DEF_FROM_EDGE (bsi.phi (), e)); bb, USE_FROM_PTR (use_p));
for (gimple_stmt_iterator bsi = gsi_start_bb (bb); !gsi_end_p (bsi); for (gimple_stmt_iterator bsi = gsi_start_bb (bb); !gsi_end_p (bsi);
gsi_next (&bsi)) gsi_next (&bsi))
{ {
gimple *stmt = gsi_stmt (bsi); gimple *stmt = gsi_stmt (bsi);
bitmap liveouts = region->liveout;
if (is_gimple_debug (stmt)) if (is_gimple_debug (stmt))
continue; liveouts = region->debug_liveout;
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES) FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
sese_build_liveouts_use (region, liveouts, bb, USE_FROM_PTR (use_p)); sese_build_liveouts_use (region, liveouts, bb, USE_FROM_PTR (use_p));
} }
} }
/* For a USE in BB, return true if BB is outside REGION and it's not
in the LIVEOUTS set. */
static bool
sese_bad_liveouts_use (sese_info_p region, bitmap liveouts, basic_block bb,
tree use)
{
gcc_assert (!bb_in_sese_p (bb, region->region));
if (TREE_CODE (use) != SSA_NAME)
return false;
unsigned ver = SSA_NAME_VERSION (use);
/* If it's in liveouts, the variable will get a new PHI node, and
the debug use will be properly adjusted. */
if (bitmap_bit_p (liveouts, ver))
return false;
basic_block def_bb = gimple_bb (SSA_NAME_DEF_STMT (use));
if (!def_bb || !bb_in_sese_p (def_bb, region->region))
return false;
return true;
}
/* Reset debug stmts that reference SSA_NAMES defined in REGION that /* Reset debug stmts that reference SSA_NAMES defined in REGION that
are not marked as liveouts. */ are not marked as liveouts. */
static void static void
sese_reset_debug_liveouts_bb (sese_info_p region, bitmap liveouts, sese_reset_debug_liveouts (sese_info_p region)
basic_block bb)
{ {
gimple_stmt_iterator bsi; bitmap_iterator bi;
ssa_op_iter iter; unsigned i;
use_operand_p use_p; EXECUTE_IF_AND_COMPL_IN_BITMAP (region->debug_liveout, region->liveout,
0, i, bi)
for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{ {
gimple *stmt = gsi_stmt (bsi); tree name = ssa_name (i);
auto_vec<gimple *, 4> stmts;
if (!is_gimple_debug (stmt)) gimple *use_stmt;
continue; imm_use_iterator use_iter;
FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, name)
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES) {
if (sese_bad_liveouts_use (region, liveouts, bb, if (! is_gimple_debug (use_stmt)
USE_FROM_PTR (use_p))) || bb_in_sese_p (gimple_bb (use_stmt), region->region))
{ continue;
gimple_debug_bind_reset_value (stmt); stmts.safe_push (use_stmt);
update_stmt (stmt); }
break; while (!stmts.is_empty ())
} {
gimple *stmt = stmts.pop ();
gimple_debug_bind_reset_value (stmt);
update_stmt (stmt);
}
} }
} }
/* Build the LIVEOUTS of REGION: the set of variables defined inside /* Build the LIVEOUTS of REGION: the set of variables defined inside
and used outside the REGION. */ and used outside the REGION. */
static void void
sese_build_liveouts (sese_info_p region, bitmap liveouts) sese_build_liveouts (sese_info_p region)
{ {
basic_block bb; basic_block bb;
gcc_assert (region->liveout == NULL
&& region->debug_liveout == NULL);
region->liveout = BITMAP_ALLOC (NULL);
region->debug_liveout = BITMAP_ALLOC (NULL);
/* FIXME: We could start iterating form the successor of sese. */ /* FIXME: We could start iterating form the successor of sese. */
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
if (!bb_in_sese_p (bb, region->region)) if (!bb_in_sese_p (bb, region->region))
sese_build_liveouts_bb (region, liveouts, bb); sese_build_liveouts_bb (region, bb);
/* FIXME: We could start iterating form the successor of sese. */
if (MAY_HAVE_DEBUG_STMTS)
FOR_EACH_BB_FN (bb, cfun)
if (!bb_in_sese_p (bb, region->region))
sese_reset_debug_liveouts_bb (region, liveouts, bb);
} }
/* Builds a new SESE region from edges ENTRY and EXIT. */ /* Builds a new SESE region from edges ENTRY and EXIT. */
...@@ -179,6 +153,8 @@ new_sese_info (edge entry, edge exit) ...@@ -179,6 +153,8 @@ new_sese_info (edge entry, edge exit)
region->region.entry = entry; region->region.entry = entry;
region->region.exit = exit; region->region.exit = exit;
region->liveout = NULL;
region->debug_liveout = NULL;
region->params.create (3); region->params.create (3);
region->rename_map = new rename_map_t; region->rename_map = new rename_map_t;
region->parameter_rename_map = new parameter_rename_map_t; region->parameter_rename_map = new parameter_rename_map_t;
...@@ -196,6 +172,8 @@ void ...@@ -196,6 +172,8 @@ void
free_sese_info (sese_info_p region) free_sese_info (sese_info_p region)
{ {
region->params.release (); region->params.release ();
BITMAP_FREE (region->liveout);
BITMAP_FREE (region->debug_liveout);
for (rename_map_t::iterator it = region->rename_map->begin (); for (rename_map_t::iterator it = region->rename_map->begin ();
it != region->rename_map->end (); ++it) it != region->rename_map->end (); ++it)
...@@ -246,17 +224,14 @@ void ...@@ -246,17 +224,14 @@ void
sese_insert_phis_for_liveouts (sese_info_p region, basic_block bb, sese_insert_phis_for_liveouts (sese_info_p region, basic_block bb,
edge false_e, edge true_e) edge false_e, edge true_e)
{ {
if (MAY_HAVE_DEBUG_STMTS)
sese_reset_debug_liveouts (region);
unsigned i; unsigned i;
bitmap_iterator bi; bitmap_iterator bi;
bitmap liveouts = BITMAP_ALLOC (NULL); EXECUTE_IF_SET_IN_BITMAP (region->liveout, 0, i, bi)
sese_build_liveouts (region, liveouts);
EXECUTE_IF_SET_IN_BITMAP (liveouts, 0, i, bi)
if (!virtual_operand_p (ssa_name (i))) if (!virtual_operand_p (ssa_name (i)))
sese_add_exit_phis_edge (bb, ssa_name (i), false_e, true_e); sese_add_exit_phis_edge (bb, ssa_name (i), false_e, true_e);
BITMAP_FREE (liveouts);
} }
/* Returns the outermost loop in SCOP that contains BB. */ /* Returns the outermost loop in SCOP that contains BB. */
...@@ -369,6 +344,8 @@ move_sese_in_condition (sese_info_p region) ...@@ -369,6 +344,8 @@ move_sese_in_condition (sese_info_p region)
if_region->true_region->region.exit if_region->true_region->region.exit
= single_succ_edge (split_edge (true_edge)); = single_succ_edge (split_edge (true_edge));
region->region = if_region->false_region->region;
return if_region; return if_region;
} }
...@@ -471,7 +448,10 @@ scev_analyzable_p (tree def, sese_l &region) ...@@ -471,7 +448,10 @@ scev_analyzable_p (tree def, sese_l &region)
&& (TREE_CODE (scev) != SSA_NAME && (TREE_CODE (scev) != SSA_NAME
|| !defined_in_sese_p (scev, region)) || !defined_in_sese_p (scev, region))
&& (tree_does_not_contain_chrecs (scev) && (tree_does_not_contain_chrecs (scev)
|| evolution_function_is_affine_p (scev)); || evolution_function_is_affine_p (scev))
&& (! loop
|| ! loop_in_sese_p (loop, region)
|| ! chrec_contains_symbols_defined_in_loop (scev, loop->num));
} }
/* Returns the scalar evolution of T in REGION. Every variable that /* Returns the scalar evolution of T in REGION. Every variable that
...@@ -518,6 +498,21 @@ scalar_evolution_in_region (const sese_l &region, loop_p loop, tree t) ...@@ -518,6 +498,21 @@ scalar_evolution_in_region (const sese_l &region, loop_p loop, tree t)
return instantiate_scev (before, loop, t); return instantiate_scev (before, loop, t);
} }
/* Return true if BB is empty, contains only DEBUG_INSNs. */
bool
sese_trivially_empty_bb_p (basic_block bb)
{
gimple_stmt_iterator gsi;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
if (gimple_code (gsi_stmt (gsi)) != GIMPLE_DEBUG
&& gimple_code (gsi_stmt (gsi)) != GIMPLE_LABEL)
return false;
return true;
}
/* Pretty print edge E to FILE. */ /* Pretty print edge E to FILE. */
void void
......
...@@ -83,6 +83,12 @@ typedef struct sese_info_t ...@@ -83,6 +83,12 @@ typedef struct sese_info_t
/* The SESE region. */ /* The SESE region. */
sese_l region; sese_l region;
/* Liveout vars. */
bitmap liveout;
/* Liveout in debug stmts. */
bitmap debug_liveout;
/* Parameters used within the SCOP. */ /* Parameters used within the SCOP. */
vec<tree> params; vec<tree> params;
...@@ -116,6 +122,8 @@ extern struct loop *outermost_loop_in_sese (sese_l &, basic_block); ...@@ -116,6 +122,8 @@ extern struct loop *outermost_loop_in_sese (sese_l &, basic_block);
extern tree scalar_evolution_in_region (const sese_l &, loop_p, tree); extern tree scalar_evolution_in_region (const sese_l &, loop_p, tree);
extern bool scev_analyzable_p (tree, sese_l &); extern bool scev_analyzable_p (tree, sese_l &);
extern bool invariant_in_sese_p_rec (tree, const sese_l &, bool *); extern bool invariant_in_sese_p_rec (tree, const sese_l &, bool *);
extern void sese_build_liveouts (sese_info_p);
extern bool sese_trivially_empty_bb_p (basic_block);
/* The number of parameters in REGION. */ /* The number of parameters in REGION. */
......
2017-10-06 Richard Biener <rguenther@suse.de> 2017-10-06 Richard Biener <rguenther@suse.de>
* gcc.dg/graphite/id-15.c: No longer expect a code generation error.
* gcc.dg/graphite/id-16.c: Likewise.
* gcc.dg/graphite/pr46168.c: Likewise.
* gcc.dg/graphite/pr68756.c: Likewise.
* gcc.dg/graphite/pr69728.c: Likewise.
* gcc.dg/graphite/pr71575-2.c: Likewise.
* gcc.dg/graphite/pr77362.c: Likewise.
* gcc.dg/graphite/pr81373.c: Likewise.
* gcc.dg/graphite/run-id-pr67700-1.c: Likewise.
* gfortran.dg/graphite/interchange-1.f: Likewise.
* gfortran.dg/graphite/pr42334-1.f: Likewise.
* gfortran.dg/graphite/pr42393-1.f90: Likewise.
* gfortran.dg/graphite/pr42393.f90: Likewise.
* gfortran.dg/graphite/pr47019.f: Likewise.
* gfortran.dg/graphite/id-17.f: Likewise.
* gfortran.dg/graphite/id-19.f: Likewise.
* gfortran.dg/graphite/run-id-2.f90: Likewise.
* gfortran.dg/graphite/pr42326-1.f90: Likewise.
* gfortran.dg/graphite/pr42326.f90: Likewise.
* gfortran.dg/graphite/pr68550-2.f90: Likewise.
* gfortran.dg/graphite/pr29581.f90: Likewise. No longer expect
a code generation error.
* gfortran.dg/graphite/run-id-3.f90: Likewise.
* gfortran.dg/graphite/pr29832.f90: Likewise.
2017-10-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/82436 PR tree-optimization/82436
* gcc.dg/vect/pr82436.c: New testcase. * gcc.dg/vect/pr82436.c: New testcase.
......
/* { dg-require-effective-target int32plus } */ /* { dg-require-effective-target int32plus } */
/* { dg-additional-options "--param graphite-allow-codegen-errors=1" { target ilp32 } } */
typedef long unsigned int size_t; typedef long unsigned int size_t;
extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
...@@ -118,5 +117,3 @@ mul_double (l1, h1, l2, h2, lv, hv) ...@@ -118,5 +117,3 @@ mul_double (l1, h1, l2, h2, lv, hv)
} }
return (*hv < 0 ? ~(toplow & tophigh) : toplow | tophigh) != 0; return (*hv < 0 ? ~(toplow & tophigh) : toplow | tophigh) != 0;
} }
/* { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" { target ilp32 } } } */
/* { dg-additional-options "--param graphite-allow-codegen-errors=1" } */
int transformation[(2*19 - 1) * (2*19 - 1)][8]; int transformation[(2*19 - 1) * (2*19 - 1)][8];
const int transformation2[8][2][2] = { const int transformation2[8][2][2] = {
...@@ -44,5 +42,3 @@ transformation_init (void) ...@@ -44,5 +42,3 @@ transformation_init (void)
} }
} }
} }
/* { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O -ftree-loop-linear -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } */ /* { dg-options "-O -ftree-loop-linear" } */
int int
foo (int a[4096], int mi, int mj) foo (int a[4096], int mi, int mj)
...@@ -13,5 +13,3 @@ foo (int a[4096], int mi, int mj) ...@@ -13,5 +13,3 @@ foo (int a[4096], int mi, int mj)
} }
return i16; return i16;
} }
/* { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O1 -floop-nest-optimize -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } */ /* { dg-options "-O1 -floop-nest-optimize" } */
unsigned int z4, pz; unsigned int z4, pz;
int nn[2]; int nn[2];
...@@ -24,5 +24,3 @@ la (void) ...@@ -24,5 +24,3 @@ la (void)
pz = xq (hn); pz = xq (hn);
} }
} }
/* { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O3 -floop-nest-optimize -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } */ /* { dg-options "-O3 -floop-nest-optimize" } */
int a[1]; int a[1];
int b, c, d, e; int b, c, d, e;
...@@ -19,5 +19,3 @@ fn1 () ...@@ -19,5 +19,3 @@ fn1 ()
} }
} }
} }
/* { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-Ofast -floop-nest-optimize -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } */ /* { dg-options "-Ofast -floop-nest-optimize" } */
int *a; int *a;
int b, c, d, e, g; int b, c, d, e, g;
...@@ -14,5 +14,3 @@ void fn1() { ...@@ -14,5 +14,3 @@ void fn1() {
} }
} }
} }
/* { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -floop-nest-optimize -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } */ /* { dg-options "-O2 -floop-nest-optimize" } */
int mc[2]; int mc[2];
int f2, sk; int f2, sk;
...@@ -18,5 +18,3 @@ zm (void) ...@@ -18,5 +18,3 @@ zm (void)
++hm; ++hm;
} }
} }
/* { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } } */
/* { dg-options "-fno-tree-scev-cprop -fgraphite-identity -O -fdump-tree-graphite-all --param graphite-allow-codegen-errors=1" } */ /* { dg-options "-fno-tree-scev-cprop -fgraphite-identity -O -fdump-tree-graphite-all" } */
void bar (void); void bar (void);
...@@ -38,4 +38,3 @@ int toto() ...@@ -38,4 +38,3 @@ int toto()
} }
/* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */ /* { dg-final { scan-tree-dump-times "number of SCoPs: 2" 1 "graphite"} } */
/* { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } } */
/* { dg-additional-options "--param graphite-allow-codegen-errors=1" } */
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
...@@ -47,5 +45,3 @@ int main() ...@@ -47,5 +45,3 @@ int main()
assert (obj->elem1[8] == 45); assert (obj->elem1[8] == 45);
return 0; return 0;
} }
/* { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } } */
! { dg-additional-options "-fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" { target ilp32 } }
SUBROUTINE SPECTOP(Dr,N) SUBROUTINE SPECTOP(Dr,N)
DIMENSION d1(0:32,0:32) , Dr(0:32,0:32) , x(0:32) DIMENSION d1(0:32,0:32) , Dr(0:32,0:32) , x(0:32)
DO k = 0 , N DO k = 0 , N
...@@ -15,4 +14,3 @@ ...@@ -15,4 +14,3 @@
ENDDO ENDDO
ENDDO ENDDO
END END
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" { target ilp32 } } }
! { dg-additional-options "-fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" { target ilp32 } }
SUBROUTINE ECCODR(FPQR) SUBROUTINE ECCODR(FPQR)
DIMENSION FPQR(25,25,25) DIMENSION FPQR(25,25,25)
INTEGER P,Q,R INTEGER P,Q,R
...@@ -14,4 +13,3 @@ ...@@ -14,4 +13,3 @@
140 QM2= QM2+TWO 140 QM2= QM2+TWO
150 PM2= PM2+TWO 150 PM2= PM2+TWO
END END
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" { target ilp32 } } }
! { dg-additional-options "--param graphite-allow-codegen-errors=1" }
subroutine foo(f1,f2,f3,f4,f5,f6,f7,f8,f9,f0,g1,g2,g3) subroutine foo(f1,f2,f3,f4,f5,f6,f7,f8,f9,f0,g1,g2,g3)
implicit none implicit none
integer f4,f3,f2,f1 integer f4,f3,f2,f1
...@@ -43,4 +42,3 @@ ...@@ -43,4 +42,3 @@
! kernel from bwaves. ! kernel from bwaves.
! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } ! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } }
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } }
! PR tree-optimization/29581 ! PR tree-optimization/29581
! { dg-do run } ! { dg-do run }
! { dg-options "-O2 -ftree-loop-linear -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } ! { dg-skip-if "" { *-*-* } { "-O0" } { "" } }
! { dg-additional-options "-ftree-loop-linear" }
SUBROUTINE FOO (K) SUBROUTINE FOO (K)
INTEGER I, J, K, A(5,5), B INTEGER I, J, K, A(5,5), B
...@@ -25,5 +26,3 @@ ...@@ -25,5 +26,3 @@
A(1,1) = 0 A(1,1) = 0
IF (ANY(A.NE.0)) CALL ABORT IF (ANY(A.NE.0)) CALL ABORT
END END
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } }
! { dg-do run } ! { dg-do run }
! { dg-options "-O2 -ftree-loop-linear" } ! { dg-skip-if "" { *-*-* } { "-O0" } { "" } }
! { dg-additional-options "-fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" { target ilp32 } } ! { dg-additional-options "-ftree-loop-linear" }
! Program to test the scalarizer ! Program to test the scalarizer
program testarray program testarray
...@@ -24,5 +24,3 @@ program testarray ...@@ -24,5 +24,3 @@ program testarray
if (b(4, n) .ne. (6 - n)) call abort if (b(4, n) .ne. (6 - n)) call abort
end do end do
end program end program
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" { target ilp32 } } }
! { dg-do compile { target i?86-*-* x86_64-*-* } } ! { dg-do compile { target i?86-*-* x86_64-*-* } }
! { dg-require-effective-target ilp32 } ! { dg-require-effective-target ilp32 }
! { dg-require-effective-target sse2 } ! { dg-require-effective-target sse2 }
! { dg-options "-O2 -floop-parallelize-all -fprefetch-loop-arrays -msse2 -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } ! { dg-options "-O2 -floop-parallelize-all -fprefetch-loop-arrays -msse2" }
subroutine phasad(t,i,ium) subroutine phasad(t,i,ium)
implicit none implicit none
...@@ -16,5 +16,3 @@ subroutine phasad(t,i,ium) ...@@ -16,5 +16,3 @@ subroutine phasad(t,i,ium)
enddo enddo
return return
end subroutine phasad end subroutine phasad
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } }
! { dg-do compile { target i?86-*-* x86_64-*-* } } ! { dg-do compile { target i?86-*-* x86_64-*-* } }
! { dg-require-effective-target ilp32 } ! { dg-require-effective-target ilp32 }
! { dg-require-effective-target sse2 } ! { dg-require-effective-target sse2 }
! { dg-options "-O2 -floop-strip-mine -fprefetch-loop-arrays -msse2 -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } ! { dg-options "-O2 -floop-strip-mine -fprefetch-loop-arrays -msse2" }
subroutine blts ( ldmx, ldmy, v, tmp1, i, j, k) subroutine blts ( ldmx, ldmy, v, tmp1, i, j, k)
implicit none implicit none
...@@ -33,5 +33,3 @@ subroutine phasad(t,i,ium) ...@@ -33,5 +33,3 @@ subroutine phasad(t,i,ium)
enddo enddo
return return
end subroutine phasad end subroutine phasad
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } }
! { dg-options "-O2 -floop-interchange -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } ! { dg-options "-O2 -floop-interchange" }
subroutine linel(icmdl,stre,anisox) subroutine linel(icmdl,stre,anisox)
real*8 stre(6),tkl(3,3),ekl(3,3),anisox(3,3,3,3) real*8 stre(6),tkl(3,3),ekl(3,3),anisox(3,3,3,3)
...@@ -14,5 +14,3 @@ ...@@ -14,5 +14,3 @@
enddo enddo
stre(1)=tkl(1,1) stre(1)=tkl(1,1)
end end
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } }
! { dg-options "-O2 -fgraphite-identity -fno-loop-block -fno-loop-interchange -fno-loop-strip-mine -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } ! { dg-options "-O2 -fgraphite-identity -fno-loop-block -fno-loop-interchange -fno-loop-strip-mine" }
MODULE beta_gamma_psi MODULE beta_gamma_psi
INTEGER, PARAMETER :: dp=KIND(0.0D0) INTEGER, PARAMETER :: dp=KIND(0.0D0)
...@@ -22,5 +22,3 @@ CONTAINS ...@@ -22,5 +22,3 @@ CONTAINS
fn_val = sum fn_val = sum
END FUNCTION basym END FUNCTION basym
END MODULE beta_gamma_psi END MODULE beta_gamma_psi
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } }
! { dg-options "-O2 -fgraphite-identity -fno-loop-block -fno-loop-interchange -fno-loop-strip-mine -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } ! { dg-options "-O2 -fgraphite-identity -fno-loop-block -fno-loop-interchange -fno-loop-strip-mine" }
MODULE beta_gamma_psi MODULE beta_gamma_psi
INTEGER, PARAMETER :: dp=KIND(0.0D0) INTEGER, PARAMETER :: dp=KIND(0.0D0)
...@@ -28,5 +28,3 @@ CONTAINS ...@@ -28,5 +28,3 @@ CONTAINS
fn_val = e0*t*u*sum fn_val = e0*t*u*sum
END FUNCTION basym END FUNCTION basym
END MODULE beta_gamma_psi END MODULE beta_gamma_psi
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } }
! { dg-options "-O -ftree-pre -fgraphite-identity -fno-tree-copy-prop -fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" } ! { dg-options "-O -ftree-pre -fgraphite-identity -fno-tree-copy-prop" }
subroutine foo (ldmx,ldmy,v) subroutine foo (ldmx,ldmy,v)
integer :: ldmx, ldmy, v, l, m integer :: ldmx, ldmy, v, l, m
...@@ -10,5 +10,3 @@ ...@@ -10,5 +10,3 @@
v(m,3,2) = m v(m,3,2) = m
end do end do
end end
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" } }
! { dg-do compile } ! { dg-do compile }
! { dg-options "-floop-nest-optimize -fcheck=bounds -O1" } ! { dg-options "-floop-nest-optimize -fcheck=bounds -O1" }
! { dg-additional-options "-fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" { target ilp32 } }
SUBROUTINE PD2VAL(RES,NDERIV,TG1,TG2,C0) SUBROUTINE PD2VAL(RES,NDERIV,TG1,TG2,C0)
INTEGER, PARAMETER :: dp=8 INTEGER, PARAMETER :: dp=8
...@@ -13,5 +12,3 @@ SUBROUTINE PD2VAL(RES,NDERIV,TG1,TG2,C0) ...@@ -13,5 +12,3 @@ SUBROUTINE PD2VAL(RES,NDERIV,TG1,TG2,C0)
RES(K)=RES(K)+DOT_PRODUCT(T1(0:3),C0(96:99,K))*T2(10) RES(K)=RES(K)+DOT_PRODUCT(T1(0:3),C0(96:99,K))*T2(10)
ENDDO ENDDO
END SUBROUTINE PD2VAL END SUBROUTINE PD2VAL
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" { target ilp32 } } }
! { dg-additional-options "-fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" { target ilp32 } }
IMPLICIT NONE IMPLICIT NONE
INTEGER, PARAMETER :: dp=KIND(0.0D0) INTEGER, PARAMETER :: dp=KIND(0.0D0)
REAL(KIND=dp) :: res REAL(KIND=dp) :: res
...@@ -65,4 +64,3 @@ CONTAINS ...@@ -65,4 +64,3 @@ CONTAINS
END FUNCTION exp_radius_very_extended END FUNCTION exp_radius_very_extended
END END
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" { target ilp32 } } }
! { dg-do run } ! { dg-do run }
! { dg-options "-ffrontend-optimize -floop-nest-optimize" } ! { dg-skip-if "" { *-*-* } { "-O0" } { "" } }
! { dg-additional-options "-fdump-tree-graphite-details --param graphite-allow-codegen-errors=1" { target ilp32 } } ! { dg-additional-options "-ffrontend-optimize -floop-nest-optimize" }
! PR 56872 - wrong front-end optimization with a single constructor. ! PR 56872 - wrong front-end optimization with a single constructor.
! Original bug report by Rich Townsend. ! Original bug report by Rich Townsend.
integer :: k integer :: k
...@@ -11,4 +11,3 @@ ...@@ -11,4 +11,3 @@
res = SUM([(s**(REAL(k-1)/REAL(m-1)),k=1,m)]) res = SUM([(s**(REAL(k-1)/REAL(m-1)),k=1,m)])
if (abs(res - 5.84732246) > 1e-6) call abort if (abs(res - 5.84732246) > 1e-6) call abort
end end
! { dg-final { scan-tree-dump-times "code generation error" 1 "graphite" { target ilp32 } } }
...@@ -1226,6 +1226,8 @@ get_reaching_def (tree var) ...@@ -1226,6 +1226,8 @@ get_reaching_def (tree var)
if (currdef == NULL_TREE) if (currdef == NULL_TREE)
{ {
tree sym = DECL_P (var) ? var : SSA_NAME_VAR (var); tree sym = DECL_P (var) ? var : SSA_NAME_VAR (var);
if (! sym)
sym = create_tmp_reg (TREE_TYPE (var));
currdef = get_or_create_ssa_default_def (cfun, sym); currdef = get_or_create_ssa_default_def (cfun, sym);
} }
......
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