public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Cc: gcc Patches <gcc-patches@gcc.gnu.org>,
	Jan Hubicka <hubicka@ucw.cz>,	Martin Jambor <mjambor@suse.cz>,
	Richard Biener <rguenther@suse.de>
Subject: Re: [RFC] Extend ipa-bitwise-cp with pointer alignment propagation
Date: Thu, 22 Sep 2016 12:12:00 -0000	[thread overview]
Message-ID: <20160922115635.GB86459@kam.mff.cuni.cz> (raw)
In-Reply-To: <CAAgBjMkR_Am6Zn26zx+Ah7AHZjhKe8J+156VWxZG74C+QZFADw@mail.gmail.com>

> Hi,
> The attached patch tries to extend ipa bits propagation to handle
> pointer alignment propagation.
> The patch just disables ipa-cp-alignment pass, I suppose we want to
> eventually remove it ?

Yes, can you please verify that alignments it computes are monotonously
worse than those your new code computes and include the removal in the
next iteration of the patch?
> 
> Bootstrap+tested on x86_64-unknown-linux-gnu.
> Cross-tested on arm*-*-*, aarch64*-*-*.
> Does the patch look OK ?
> 
> Thanks,
> Prathamesh
> @@ -2258,8 +2271,8 @@ propagate_constants_accross_call (struct cgraph_edge *cs)
>  							 &dest_plats->itself);
>  	  ret |= propagate_context_accross_jump_function (cs, jump_func, i,
>  							  &dest_plats->ctxlat);
> -	  ret |= propagate_alignment_accross_jump_function (cs, jump_func,
> -							 &dest_plats->alignment);
> +//	  ret |= propagate_alignment_accross_jump_function (cs, jump_func,
> +//							 &dest_plats->alignment);

obviously we do not want commented out ocde..

>  	  ret |= propagate_bits_accross_jump_function (cs, i, jump_func,
>  						       &dest_plats->bits_lattice);
>  	  ret |= propagate_aggs_accross_jump_function (cs, jump_func,
> diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
> index 1629781..5cee27b 100644
> --- a/gcc/ipa-prop.c
> +++ b/gcc/ipa-prop.c
> @@ -1701,6 +1701,16 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi,
>  	      jfunc->bits.mask = 0;
>  	    }
>  	}
> +      else if (POINTER_TYPE_P (TREE_TYPE (arg)))
> +	{
> +	  unsigned HOST_WIDE_INT bitpos;
> +	  unsigned align;
> +
> +	  jfunc->bits.known = true;
> +	  get_pointer_alignment_1 (arg, &align, &bitpos);
> +	  jfunc->bits.mask = wi::mask<widest_int>(TYPE_PRECISION (TREE_TYPE (arg)), false).and_not (align / BITS_PER_UNIT - 1);

... and long lines :)

> +	  jfunc->bits.value = bitpos / BITS_PER_UNIT;
> +	}
>        else
>  	gcc_assert (!jfunc->bits.known);
>  
> @@ -5534,7 +5544,7 @@ ipcp_update_bits (struct cgraph_node *node)
>        next_parm = DECL_CHAIN (parm);
>  
>        if (!bits[i].known
> -	  || !INTEGRAL_TYPE_P (TREE_TYPE (parm))
> +	  || !(INTEGRAL_TYPE_P (TREE_TYPE (parm)) || POINTER_TYPE_P (TREE_TYPE (parm)))

I suppose eventually we may want to enable other types, too.
It does even make sense to propagate this on aggregates, but definitly on
vectors and complex numbers.  

Otherwise the patch seems fine to me (modulo Richard's comments)
Honza

  parent reply	other threads:[~2016-09-22 11:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 17:25 Prathamesh Kulkarni
2016-09-22  9:38 ` Richard Biener
2016-09-22  9:41   ` Richard Biener
2016-09-22 12:12 ` Jan Hubicka [this message]
2016-10-03 19:07   ` Prathamesh Kulkarni
2016-10-04 14:54     ` Jan Hubicka
2016-10-05 14:16     ` Martin Jambor
2016-10-06  4:55       ` Prathamesh Kulkarni
2016-10-06 13:21         ` Jan Hubicka
2016-10-06 20:55           ` Prathamesh Kulkarni
2016-10-08 17:31             ` Jan Hubicka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160922115635.GB86459@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mjambor@suse.cz \
    --cc=prathamesh.kulkarni@linaro.org \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).