public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@bitrange.com>
To: Jeff Law <law@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Don't allow FSM threader to create irreducible loops unless it eliminates a multi-way branch
Date: Wed, 21 Oct 2015 00:05:00 -0000	[thread overview]
Message-ID: <alpine.BSF.2.02.1510201955140.46548@arjuna.pair.com> (raw)
In-Reply-To: <56251919.5050104@redhat.com>

On Mon, 19 Oct 2015, Jeff Law wrote:
> If I hack up GCC's old jump threader to avoid threading across backedges and
> instead let the FSM threader handle that case, then we end up with cases where
> the FSM threader creates irreducible loops with marginal benefit.
>
> This can be seen in ssa-dom-thread-2{d,e,f}.c.
>
> We've long avoided such threads in the old jump threader.  We generally want
> to avoid them in the FSM threader as well.  The only case where we're going to
> allow them is when we're able to eliminate a multi-way branch from the loop.
>
> Bootstrapped and regression tested on x86_64-linux-gnu.  Also tested the above
> mentioned testcases with my hacked up compiler.
>
> Installed on the trunk.

Please do *not* backport this, it causes
unreachable-jump-table-entry issues for cris-elf, breaking build
in newlib.  Although this *is* a manifestation of undue reliance
on assembler broken-dot-word support for this target, I can
imagine similar issues with branches stretched beyond optimal
limit for other targets.

I have no idea whether there's an actual bug related to the
patch or something "just waiting to happen" and 16-bit-offsets
just too close to the limits.  Brief inspection of the generated
assembly-code is, well, "inconclusive".  Also, I'm travelling at
the moment.

<non-inline patch can't be quoted, but it's r228974 on trunk.>

brgds, H-P

  reply	other threads:[~2015-10-21  0:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 16:24 Jeff Law
2015-10-21  0:05 ` Hans-Peter Nilsson [this message]
2015-10-21  0:13   ` Bernd Schmidt
2015-10-21  4:46   ` Jeff Law
2015-10-21 12:12     ` Hans-Peter Nilsson
2015-10-21 14:44       ` Jeff Law
2015-10-21  9:06 ` Richard Biener
2015-10-21 14:53   ` 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=alpine.BSF.2.02.1510201955140.46548@arjuna.pair.com \
    --to=hp@bitrange.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).