+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
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
+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
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;
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. */