GCC with patches for OS216
修订版 | 019d6598357659e05640cf762b75e18953f70fe9 (tree) |
---|---|
时间 | 2016-07-07 20:50:55 |
作者 | Jan Hubicka <jh@suse...> |
Commiter | 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
@@ -1,3 +1,9 @@ | ||
1 | +2016-07-07 Jan Hubicka <jh@suse.cz> | |
2 | + | |
3 | + * tree-scalar-evolution.c (iv_can_overflow_p): export. | |
4 | + * tree-scalar-evolution.h (iv_can_overflow_p): Declare. | |
5 | + * tree-ssa-loop-ivopts.c (alloc_iv): Use it. | |
6 | + | |
1 | 7 | 2016-07-07 Ilya Enkovich <ilya.enkovich@intel.com> |
2 | 8 | |
3 | 9 | PR ipa/71624 |
@@ -3317,7 +3317,7 @@ scev_reset (void) | ||
3317 | 3317 | use this test even for derived IVs not computed every iteration or |
3318 | 3318 | hypotetical IVs to be inserted into code. */ |
3319 | 3319 | |
3320 | -static bool | |
3320 | +bool | |
3321 | 3321 | iv_can_overflow_p (struct loop *loop, tree type, tree base, tree step) |
3322 | 3322 | { |
3323 | 3323 | widest_int nit; |
@@ -38,6 +38,7 @@ extern unsigned int scev_const_prop (void); | ||
38 | 38 | extern bool expression_expensive_p (tree); |
39 | 39 | extern bool simple_iv (struct loop *, struct loop *, tree, struct affine_iv *, |
40 | 40 | bool); |
41 | +extern bool iv_can_overflow_p (struct loop *, tree, tree, tree); | |
41 | 42 | extern tree compute_overall_effect_of_inner_loop (struct loop *, tree); |
42 | 43 | |
43 | 44 | /* 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 | 1181 | iv->biv_p = false; |
1182 | 1182 | iv->nonlin_use = NULL; |
1183 | 1183 | iv->ssa_name = NULL_TREE; |
1184 | + if (!no_overflow | |
1185 | + && !iv_can_overflow_p (data->current_loop, TREE_TYPE (base), | |
1186 | + base, step)) | |
1187 | + no_overflow = true; | |
1184 | 1188 | iv->no_overflow = no_overflow; |
1185 | 1189 | iv->have_address_use = false; |
1186 | 1190 |