public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Renlin Li <renlin.li@arm.com>
To: Jeff Law <law@redhat.com>,
	 "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Marcus Shawcroft <Marcus.Shawcroft@arm.com>
Subject: Re: [PATCH] Improve DOM's optimization of control statements
Date: Fri, 02 Oct 2015 11:15:00 -0000	[thread overview]
Message-ID: <560E6759.3020806@arm.com> (raw)
In-Reply-To: <560C45EE.10202@redhat.com>

Hi Jeff,

Your patch causes an ICE regression.
The test case is " gcc.c-torture/compile/pr27087.c", I observed it on 
aarch64-none-elf target when compiling the test case with '-Os' flag.

A quick check shows, the cfg has been changed, but the loop information 
is not updated. Thus the information about the number of basic block in 
a loop is not reliable.

Could you please have a look?

Regards,
Renlin

On 30/09/15 21:28, Jeff Law wrote:
> Until now DOM has had to be very conservative with handling control
> statements with known conditions.  This as been an unfortunate side
> effect of the interaction between removing edges and recycling names via
> the SSA_NAME manager.
>
> Essentially DOM would have to leave control statements alone.  So you'd
> see stuff like
>
> if (0 == 0)
>
> left around by DOM.  The jump threader would thankfully come along and
> optimize that as a jump thread.  But that's terribly inefficient, not to
> mention it creates unnecessary churn in the CFG and SSA_NAMEs.
>
> By optimizing that directly in DOM, including removing whatever edges
> are not executable, we no longer have to rely on jump threading to
> handle that case.  Less churn in the CFG & SSA_NAMEs.   There's also
> some chance for secondary optimizations with fewer edges left in the CFG
> for DOM to consider.
>
> Unfortunately, the churn caused by jump threading made it excessively
> difficult to analyze before/after dumps.  Sadly, you can have the same
> code, but if the SSA_NAMEs have changed, that impacts coalescing as we
> leave SSA.  Churn in the CFG changes labels/jumps, often without
> changing the actual structure, etc.
>
> I did some tests with valgrind to evaluate branching behaviour
> before/after effects on the resulting code and those effects were tiny,
> in the I doubt you could measure them range.  That was expected since
> what we're really doing here is just capturing the optimization earlier.
>
> I had a couple more tests, but they were lost in a bit of idiocy.  The
> test included is the one I had a second copy of lying around.
>
> Bootstrapped and regression tested on x86_64-linux-gnu.  Installed on
> the trunk.
>
> Jeff

  reply	other threads:[~2015-10-02 11:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 22:11 Jeff Law
2015-10-02 11:15 ` Renlin Li [this message]
2015-10-02 15:15   ` Jeff Law
2015-10-02 16:25   ` Jeff Law
2015-10-02 19:30   ` Jeff Law
2015-10-05  9:02     ` Richard Biener
2015-10-06 17:41       ` Jeff Law
2015-10-07 21:56       ` Jeff Law
2015-10-07 22:03 ` Andreas Schwab
2015-10-07 22:06   ` Jeff Law

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=560E6759.3020806@arm.com \
    --to=renlin.li@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    /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).