re PR tree-optimization/82449 (code-gen error in get_rename_from_scev)

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

	PR tree-optimization/82449
	* sese.c (scev_analyzable_p): Check whether the SCEV is linear.
	* tree-chrec.h (evolution_function_is_constant_p): Adjust to
	allow constant addresses.
	* tree-chrec.c (scev_is_linear_expression): Constant evolutions
	are linear.

	* gfortran.dg/graphite/pr82449.f: New testcase.

From-SVN: r253546
This commit is contained in:
Richard Biener 2017-10-09 13:50:10 +00:00 committed by Richard Biener
parent 14108eda7e
commit 7668b0a656
6 changed files with 38 additions and 17 deletions

View File

@ -1,3 +1,12 @@
2017-10-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/82449
* sese.c (scev_analyzable_p): Check whether the SCEV is linear.
* tree-chrec.h (evolution_function_is_constant_p): Adjust to
allow constant addresses.
* tree-chrec.c (scev_is_linear_expression): Constant evolutions
are linear.
2017-10-09 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390-builtins.def (vec_nabs, vec_vfi): Fix builtin

View File

@ -444,14 +444,13 @@ scev_analyzable_p (tree def, sese_l &region)
loop = loop_containing_stmt (SSA_NAME_DEF_STMT (def));
scev = scalar_evolution_in_region (region, loop, def);
return !chrec_contains_undetermined (scev)
&& (TREE_CODE (scev) != SSA_NAME
|| !defined_in_sese_p (scev, region))
&& (tree_does_not_contain_chrecs (scev)
|| evolution_function_is_affine_p (scev))
&& (! loop
|| ! loop_in_sese_p (loop, region)
|| ! chrec_contains_symbols_defined_in_loop (scev, loop->num));
return (!chrec_contains_undetermined (scev)
&& (TREE_CODE (scev) != SSA_NAME
|| !defined_in_sese_p (scev, region))
&& scev_is_linear_expression (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

View File

@ -1,3 +1,8 @@
2017-10-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/82449
* gfortran.dg/graphite/pr82449.f: New testcase.
2017-10-09 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/82463

View File

@ -0,0 +1,11 @@
! { dg-do compile }
! { dg-options "-O2 -floop-nest-optimize" }
SUBROUTINE JDFIDX(MKL,KGSH)
DIMENSION MKL(6,6)
NKL=0
400 DO 40 KG = 1,KGSH
DO 40 LG = 1,KG
NKL = NKL + 1
40 MKL(LG,KG) = NKL
END

View File

@ -1610,6 +1610,9 @@ operator_is_linear (tree scev)
bool
scev_is_linear_expression (tree scev)
{
if (evolution_function_is_constant_p (scev))
return true;
if (scev == NULL
|| !operator_is_linear (scev))
return false;

View File

@ -169,15 +169,9 @@ evolution_function_is_constant_p (const_tree chrec)
if (chrec == NULL_TREE)
return false;
switch (TREE_CODE (chrec))
{
case INTEGER_CST:
case REAL_CST:
return true;
default:
return false;
}
if (CONSTANT_CLASS_P (chrec))
return true;
return is_gimple_min_invariant (chrec);
}
/* Determine whether CHREC is an affine evolution function in LOOPNUM. */