public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Jambor <mjambor@suse.cz>
To: Feng Xue OS <fxue@os.amperecomputing.com>,
	"gcc-patches\@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PATCH] Setup predicate for switch default case in IPA (PR ipa/91089)
Date: Thu, 29 Aug 2019 15:14:00 -0000	[thread overview]
Message-ID: <ri6imqgaufd.fsf@suse.cz> (raw)
In-Reply-To: <BYAPR01MB48690FF0F2D7FCFE48DC17B7F7F20@BYAPR01MB4869.prod.exchangelabs.com>

Hi,

On Fri, Jul 12 2019, Feng Xue OS wrote:
> IPA does not construct executability predicate for default case of switch statement.
> So execution cost of default case is not properly evaluated in IPA-cp, this might
> prevent function clone for function containing switch statement, if certain non-default
> case is proved to be executed after constant propagation.
>
> This patch is composed to deduce predicate for default case, if it turns out to be a
> relative simple one, for example, we can try to merge case range, and use
> comparison upon range bounds, and also range analysis information to simplify 
> predicate.
>

I have read through the patch and it looks OK to me but I cannot approve
it, you have to ping Honza for that.  Since you decided to use the value
range info, it would be nice if you could also add a testcase where it
plays a role.  Also, please don't post changelog entries as a part of
the patch, it basically guarantees it will not apply for anybody, not
even for you when you update your trunk.

Thanks for working on this,

Martin


> Feng
>
> ----
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index 3d92250b520..4de2f568990 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,10 @@
> +2019-07-12  Feng Xue  <fxue@os.amperecomputing.com>
> +
> +	PR ipa/91089
> +	* ipa-fnsummary.c (set_switch_stmt_execution_predicate): Add predicate
> +	for switch default case using range analysis information.
> +	* params.def (PARAM_IPA_MAX_SWITCH_PREDICATE_BOUNDS): New.
> +
>  2019-07-11  Sunil K Pandey  <sunil.k.pandey@intel.com>
>  

  reply	other threads:[~2019-08-29 15:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  8:51 Feng Xue OS
2019-08-29 15:14 ` Martin Jambor [this message]
2019-08-30  8:32   ` Feng Xue OS
2019-09-02  3:06   ` [PATCH V2] " Feng Xue OS
2019-09-14 15:57     ` Jan Hubicka
2019-09-16 10:11       ` [PATCH 1/2 V3] " Feng Xue OS
2019-09-16 15:04         ` Jan Hubicka
2019-09-17 13:51           ` Feng Xue OS
2019-09-16 10:16       ` [PATCH 2/2 V3] Use post-dom info to update if/switch predicate " Feng Xue OS
2019-09-16 15:05         ` Jan Hubicka
2019-09-17 13:54           ` Feng Xue OS

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=ri6imqgaufd.fsf@suse.cz \
    --to=mjambor@suse.cz \
    --cc=fxue@os.amperecomputing.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /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).