This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC][PATCH 2/3] Propagate and save value ranges wrapped information
- From: Richard Biener <rguenther at suse dot de>
- To: Kugan <kugan dot vivekanandarajah at linaro dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>, Jeff Law <law at redhat dot com>
- Date: Mon, 19 Jan 2015 12:28:03 +0100 (CET)
- Subject: Re: [RFC][PATCH 2/3] Propagate and save value ranges wrapped information
- Authentication-results: sourceware.org; auth=none
- References: <54B9C2EE dot 4050100 at linaro dot org> <54B9C45B dot 3010704 at linaro dot org>
On Sat, 17 Jan 2015, Kugan wrote:
>
> This patch propagate value range wrapps attribute and save this to
> SSA_NAME.
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 9b7695d..832c35d 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -103,6 +103,9 @@ struct value_range_d
tree min;
tree max;
+ /* Set to true if values in this value range could wrapp. */
+ bool is_wrapped;
+
/* Set of SSA names whose value ranges are equivalent to this one.
This set is only valid when TYPE is VR_RANGE or VR_ANTI_RANGE. */
bitmap equiv;
I can't make sense of this description (wrap with one p as well).
I assume you mean that the expression that has this value-range
assigned has an operation that may have wrapped? (a value
can't wrap)
You need to specify how is_wrapped behaves for range union and
intersect operations and which operations can wrap.
I miss an overall description of these patches as to a) why you
need this information and b) why it helps.
It's now also too late and thus you have plenty of time until stage1
starts again.
Thanks,
Richard.
> Thanks,
> Kugan
>
> gcc/ChangeLog:
>
> 2015-01-16 Kugan Vivekanandarajah <kuganv@linaro.org>
>
> * builtins.c (determine_block_size): Use new definition of
> get_range_info.
> * gimple-pretty-print.c (dump_ssaname_info): Dump new wrapped info.
> * internal-fn.c (get_range_pos_neg): Use new definition of
> get_range_info.
> (get_min_precision): Likewise.
> * tree-ssa-copy.c (fini_copy_prop): Use new definition of
> duplicate_ssa_range_info.
> * tree-ssa-loop-im.c
> (move_computations_dom_walker::before_dom_children): Likewise.
> * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Likewise.
> * tree-ssa-loop-niter.c (determine_value_range): Use new definition.
> * tree-ssanames.c (set_range_info): Save wrapped information.
> (get_range_info): Retrive wrapped information.
> (set_nonzero_bits): Set wrapped info.
> (duplicate_ssa_name_range_info): Likewise.
> (duplicate_ssa_name_fn): Likewise.
> * tree-ssanames.h: (set_range_info): Update definition.
> (get_range_info): Ditto.
> * tree-vect-patterns.c (vect_recog_divmod_pattern): Use new
> declaration get_range_info.
> * tree-vrp.c (struct value_range_d): Add wrapped field.
> (set_value_range): Calculate and add wrapped field.
> (set_and_canonicalize_value_range): Likewise.
> (copy_value_range): Likewise.
> (set_value_range_to_value): Likewise.
> (set_value_range_to_nonnegative): Likewise.
> (set_value_range_to_nonnull): Likewise.
> (set_value_range_to_truthvalue): Likewise.
> (abs_extent_range): Likewise.
> (get_value_range): Return wrapped info.
> (update_value_range): Save wrapped info.
> (extract_range_from_assert): Extract and update wrapped info.
> (extract_range_from_ssa_name): Likewise.
> (vrp_int_const_binop): Likewise.
> (extract_range_from_multiplicative_op_1): Likewise.
> (extract_range_from_binary_expr_1): Likewise.
> (extract_range_from_binary_expr): Likewise.
> (extract_range_from_unary_expr_1): Likewise.
> (extract_range_from_comparison): Likewise.
> (extract_range_basic): Likewise.
> (adjust_range_with_scev): Likewise.
> (dump_value_range): Dump wrapped info.
> (remove_range_assertions): Update parameters.
> (vrp_intersect_ranges_1): Propagate wrapped info.
> (vrp_meet_1): Likewise.
> (vrp_visit_phi_node): Save wrapped info to SSA.
> (vrp_finalize): Likewise.
> * tree.h (SSA_NAME_ANTI_RANGE_P): Remove.
> (SSA_NAME_RANGE_OVF_P): New.
>
> gcc/testsuite/ChangeLog:
>
> 2015-01-16 Kugan Vivekanandarajah <kuganv@linaro.org>
>
> * gcc.dg/tree-ssa/vrp92.c: Update scanned pattern.
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Jennifer Guild,
Dilip Upmanyu, Graham Norton HRB 21284 (AG Nuernberg)