public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [RFC] sched: Do not move expensive insns speculatively (PR68664)
Date: Fri, 27 Jan 2017 12:42:00 -0000	[thread overview]
Message-ID: <20170127123851.GC30284@gate.crashing.org> (raw)
In-Reply-To: <CAFiYyc0nK3nEja53ZG5Uz-CpBpnbmte9XxdgWwGaN9=LL7m_4Q@mail.gmail.com>

On Fri, Jan 27, 2017 at 01:15:27PM +0100, Richard Biener wrote:
> As both SQRT and DIV may trap I wonder how we can end up speculating
> them at all?

The testcase uses -ffast-math.

> Ok, maybe with -fno-trapping-math we don't consider that case but even
> then generating
> a NaN is usually dreadfully slow so avoiding speculation of such insns
> looks good in
> any case (w/o considering its cost).

And -ffast-math includes -ffinite-math-only.  No, the testcase never
takes the square root of number smaller than zero, it isn't *that* slow ;-)

Things slow down so much because there is a loop immediately followed
by a square root insn, and sched-rgn decides it is a good idea to move
it to inside the loop.  Which is a bad idea no matter what the frequency
of the loop is because 1) we do not get such profiles very correct, and
2) sqrt is really expensive.


Segher

  reply	other threads:[~2017-01-27 12:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27  0:40 Segher Boessenkool
2017-01-27  1:12 ` Andrew Pinski
2017-01-27  1:27   ` Segher Boessenkool
2017-01-27  2:12     ` Andrew Pinski
2017-01-27 11:36       ` Ramana Radhakrishnan
2017-01-27 12:43         ` Segher Boessenkool
2017-01-27 18:11         ` Jeff Law
2017-01-27 12:45     ` Bernd Schmidt
2017-01-27 14:19       ` Segher Boessenkool
2017-01-27 18:20       ` Jeff Law
2017-01-27 12:20 ` Richard Biener
2017-01-27 12:42   ` Segher Boessenkool [this message]
2017-01-27 13:43     ` Richard Biener
2017-01-27 14:37       ` Segher Boessenkool
2017-01-27 18:08         ` Jeff Law
2017-01-27 22:04           ` Segher Boessenkool
2017-01-27 22:21             ` Jeff Law
2017-01-27 22:30               ` Segher Boessenkool

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=20170127123851.GC30284@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.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).