mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 04:10:26 +08:00
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:
parent
14108eda7e
commit
7668b0a656
@ -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
|
||||
|
15
gcc/sese.c
15
gcc/sese.c
@ -444,14 +444,13 @@ scev_analyzable_p (tree def, sese_l ®ion)
|
||||
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
|
||||
|
@ -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
|
||||
|
11
gcc/testsuite/gfortran.dg/graphite/pr82449.f
Normal file
11
gcc/testsuite/gfortran.dg/graphite/pr82449.f
Normal 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
|
@ -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;
|
||||
|
@ -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. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user