tree-scalar-evolution.c (iv_can_overflow_p): export.

* tree-scalar-evolution.c (iv_can_overflow_p): export.
	* tree-scalar-evolution.h (iv_can_overflow_p): Declare.
	* tree-ssa-loop-ivopts.c (alloc_iv): Use it.

From-SVN: r238088
This commit is contained in:
Jan Hubicka 2016-07-07 13:50:55 +02:00 committed by Jan Hubicka
parent 275792f2eb
commit 019d659835
4 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-07-07 Jan Hubicka <jh@suse.cz>
* tree-scalar-evolution.c (iv_can_overflow_p): export.
* tree-scalar-evolution.h (iv_can_overflow_p): Declare.
* tree-ssa-loop-ivopts.c (alloc_iv): Use it.
2016-07-07 Ilya Enkovich <ilya.enkovich@intel.com>
PR ipa/71624

View File

@ -3317,7 +3317,7 @@ scev_reset (void)
use this test even for derived IVs not computed every iteration or
hypotetical IVs to be inserted into code. */
static bool
bool
iv_can_overflow_p (struct loop *loop, tree type, tree base, tree step)
{
widest_int nit;

View File

@ -38,6 +38,7 @@ extern unsigned int scev_const_prop (void);
extern bool expression_expensive_p (tree);
extern bool simple_iv (struct loop *, struct loop *, tree, struct affine_iv *,
bool);
extern bool iv_can_overflow_p (struct loop *, tree, tree, tree);
extern tree compute_overall_effect_of_inner_loop (struct loop *, tree);
/* Returns the basic block preceding LOOP, or the CFG entry block when

View File

@ -1181,6 +1181,10 @@ alloc_iv (struct ivopts_data *data, tree base, tree step,
iv->biv_p = false;
iv->nonlin_use = NULL;
iv->ssa_name = NULL_TREE;
if (!no_overflow
&& !iv_can_overflow_p (data->current_loop, TREE_TYPE (base),
base, step))
no_overflow = true;
iv->no_overflow = no_overflow;
iv->have_address_use = false;