This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ping][PATCH][1 of 2] Add value range info to SSA_NAME for zero sign extension elimination in RTL
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: Kugan <kugan dot vivekanandarajah at linaro dot org>, Richard Biener <richard dot guenther at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Eric Botcazou <ebotcazou at adacore dot com>, Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Tue, 10 Sep 2013 15:40:06 +0200
- Subject: Re: [ping][PATCH][1 of 2] Add value range info to SSA_NAME for zero sign extension elimination in RTL
- Authentication-results: sourceware.org; auth=none
- References: <51BE66E8 dot 3010401 at linaro dot org> <alpine dot LNX dot 2 dot 00 dot 1306171045180 dot 22313 at zhemvz dot fhfr dot qr> <51D41852 dot 9050508 at linaro dot org> <CAFiYyc10HBW1PX+3jAQ=yJKfTjkP-9F2DnujNhU_ZBE0xG8_uQ at mail dot gmail dot com> <5225D2E4 dot 303 at linaro dot org> <52297A5B dot 1010309 at suse dot de> <522D03B9 dot 6060201 at linaro dot org> <CAFiYyc0xYQQ9Cpsw5wVgy3zsxNppuJzyUyAg8Y4u90nKad+k8w at mail dot gmail dot com> <522E99DD dot 2080505 at linaro dot org> <alpine dot LNX dot 2 dot 00 dot 1309101432560 dot 3150 at zhemvz dot fhfr dot qr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Sep 10, 2013 at 03:17:50PM +0200, Richard Biener wrote:
> > unsigned short s;
> > s.1_3 = (short unsigned int) l.0_2;
> > l.0_2: VARYING
> > s.1_3: [0, +INF]
>
> Note that [0, +INF] is the same as VARYING and [-INF, +INF] and VARYING for
> l.0_2 is the same as [-INF, +INF].
Yeah, I don't see much value in differentiating between VR_VARYING and
VR_RANGE [TYPE_MIN_VALUE, TYPE_MAX_VALUE] (perhaps a question is what to do
for types with precisions different from TYPE_MODE's bitsize, if we should
store for VARYING/UNDEFINED a range of all possible values in the mode).
Unsigned type will be always >= 0, even if it is VARYING or UNDEFINED.
What is the valid bit good for? Is it meant just for integrals with >
2*HOST_BITS_PER_WIDE_INT precision, which we can't represent in double_int?
I'd say we just don't want to keep track on the value ranges for those.
And, do we need to distinguish between VR_RANGE and VR_ANTI_RANGE?
I mean, can't we always store the range in VR_RANGE format? Instead of
-[3,7] we'd store [8,2] and define that if the min double_int is bigger than
max double_int, then it is [min,+infinity] merged with [-infinity,max] range
(i.e. -[max+1,min-1])?
> Micha just suggested
>
> union vrp_info_type {
> /* Pointer attributes used for alias analysis. */
> struct GTY ((tag ("0"))) ptr_info_def *ptr_info;
> /* Value range attributes used for zero/sign extension elimination.
> */
> struct GTY ((tag ("1"))) range_info_def *range_info;
> } GTY ((desc ("%1.typed.type ? !POINTER_TYPE_P (TREE_TYPE
Why not TREE_TYPE(&%1) here and why the (tree) cast?
Jakub