public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: "Martin Liška" <mliska@suse.cz>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Improve profile handling in switch lowering.
Date: Mon, 28 Nov 2022 10:38:41 -0700	[thread overview]
Message-ID: <1a66c1f0-8525-f86e-bd8e-7c706a1135b4@gmail.com> (raw)
In-Reply-To: <596c4483-864c-1d03-955c-69906171f037@suse.cz>



On 1/26/22 04:11, Martin Liška wrote:
> Hello.
> 
> Right now, switch lowering does not update basic_block::count values
> so that they are uninitiliazed. Moreover, I've updated probability scaling
> when a more complex expansion happens. There are still some situations 
> where
> the profile is a bit imprecise, but the patch improves rapidly the 
> current situation.
> 
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> 
> Ready to be installed?
> Thanks,
> Martin
> 
>      PR tree-optimization/101301
>      PR tree-optimization/103680
> 
> gcc/ChangeLog:
> 
>      * tree-switch-conversion.cc (bit_test_cluster::emit):
>      Handle correctly remaining probability.
>      (switch_decision_tree::try_switch_expansion): Fix BB's count
>      where a cluster expansion happens.
>      (switch_decision_tree::emit_cmp_and_jump_insns): Fill up also
>      BB count.
>      (switch_decision_tree::do_jump_if_equal): Likewise.
>      (switch_decision_tree::emit_case_nodes): Handle special case
>      for BT expansion which can also fallback to a default BB.
>      * tree-switch-conversion.h (cluster::cluster): Add
>      m_default_prob probability.
Funny you just ping'd this patch.  I've held it in my queue for months 
as I didn't see it get installed.

As far as I'm concerned, you know the switch conversion bits better than 
anyone.  If you think the patch significantly improves the profile 
handling for switch conversion, then I'd say go for it.  Particularly 
since it seems to fix at least two known bugs.


Keff

      parent reply	other threads:[~2022-11-28 17:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 11:11 Martin Liška
2022-03-04 13:47 ` Martin Liška
2022-03-24 10:22   ` Martin Liška
2022-04-07 14:00     ` Martin Liška
2022-11-28  9:53       ` Martin Liška
2022-11-28 17:38 ` Jeff Law [this message]

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=1a66c1f0-8525-f86e-bd8e-7c706a1135b4@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.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).