Commit 019d6598 by Jan Hubicka Committed by Jan Hubicka

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
parent 275792f2
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> 2016-07-07 Ilya Enkovich <ilya.enkovich@intel.com>
PR ipa/71624 PR ipa/71624
......
...@@ -3317,7 +3317,7 @@ scev_reset (void) ...@@ -3317,7 +3317,7 @@ scev_reset (void)
use this test even for derived IVs not computed every iteration or use this test even for derived IVs not computed every iteration or
hypotetical IVs to be inserted into code. */ hypotetical IVs to be inserted into code. */
static bool bool
iv_can_overflow_p (struct loop *loop, tree type, tree base, tree step) iv_can_overflow_p (struct loop *loop, tree type, tree base, tree step)
{ {
widest_int nit; widest_int nit;
......
...@@ -38,6 +38,7 @@ extern unsigned int scev_const_prop (void); ...@@ -38,6 +38,7 @@ extern unsigned int scev_const_prop (void);
extern bool expression_expensive_p (tree); extern bool expression_expensive_p (tree);
extern bool simple_iv (struct loop *, struct loop *, tree, struct affine_iv *, extern bool simple_iv (struct loop *, struct loop *, tree, struct affine_iv *,
bool); bool);
extern bool iv_can_overflow_p (struct loop *, tree, tree, tree);
extern tree compute_overall_effect_of_inner_loop (struct loop *, tree); extern tree compute_overall_effect_of_inner_loop (struct loop *, tree);
/* Returns the basic block preceding LOOP, or the CFG entry block when /* Returns the basic block preceding LOOP, or the CFG entry block when
......
...@@ -1181,6 +1181,10 @@ alloc_iv (struct ivopts_data *data, tree base, tree step, ...@@ -1181,6 +1181,10 @@ alloc_iv (struct ivopts_data *data, tree base, tree step,
iv->biv_p = false; iv->biv_p = false;
iv->nonlin_use = NULL; iv->nonlin_use = NULL;
iv->ssa_name = NULL_TREE; 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->no_overflow = no_overflow;
iv->have_address_use = false; iv->have_address_use = false;
......
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