public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Michael Meissner <meissner@linux.vnet.ibm.com>,
	David Edelsohn <dje.gcc@gmail.com>,
		GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR target/65240, Fix Power{7,8} insn constraint issue with -O3 -ffast-math
Date: Wed, 18 Mar 2015 11:08:00 -0000	[thread overview]
Message-ID: <CAFiYyc0qLRYMwR5Omz9UOWixw3mdEp79pkz9jMvOymPH-pmBVQ@mail.gmail.com> (raw)
In-Reply-To: <20150317231840.GA24459@ibm-tiger.the-meissners.org>

On Wed, Mar 18, 2015 at 12:18 AM, Michael Meissner
<meissner@linux.vnet.ibm.com> wrote:
> On Thu, Mar 12, 2015 at 11:37:14AM -0400, David Edelsohn wrote:
>> Please check on the performance implications of removing the special
>> constant support.  I know that it is late, but I think that ripping it
>> out is less risky than trying to fix this, if the performance impact
>> is not bad.
>
> Now, I haven't drilled down to exactly what is causing the performance
> differences, but I've done some Spec 2006 runs comparing subversion id 221194,
> with the two patches.
>
> The first patch is a rewrite of the code that I originally put into the
> compiler to move floating point constants under -ffast-math during the first
> split pass.  A minor tweak would need to be done to the original patch so that
> it works with -mcmodel=small or -m32 options.
>
> The second patch completely eliminates keeping the non-0 constant around in
> RTL, and pushes it to memory during the initial RTL generation, since it is
> felt that the RTL optimizations no longer need the constant in RTL to convert
> division by constant into multiplication by the reciprocal.
>
> The benchmarcks that show a difference are.  Note, I do not count benchmarks
> that differ by less than 2% to be significant.  Percentages more than 100% mean
> the benchmark ran faster:
>
> Benchmark               Patch-1         Patch-2
> =========               =======         =======
> 401.bzip2               102.59%         103.51%
> 462.libquantum          100.28%          97.52%
> 483.xalancbmk            97.72%          97.90%
> 435.gromacs             104.48%          99.39%
> 436.cactusADM           102.19%         102.90%
> 470.lbm                 100.39%          97.45%
> Spec INT score           99.86%          99.86%
> Spec FP score           100.50%          99.81%
>
> Patch #1 had 3 faster benchmarks and 1 slower benchmark.  Patch #2 had 2 faster
> benchmarks, and 3 slower benchmarks.

Did you double-check if there are any differences in generated code?
Esp. the SPEC INT benchmarks look odd - they don't contain any
FP code.

Richard.

> I tend to feel patch #2 is cleaner, though it is slightly slower.  However, I
> can go with patch #1 if desired.
>
> Patch #2 bootstrapped fine, and had no regressions in the test suite.  Did
> you want me to install patch #1, patch #2, or do you want more information?
>
> [gcc]
> 2015-03-17  Michael Meissner  <meissner@linux.vnet.ibm.com>
>
>         PR target/65240
>         * config/rs6000/predicates.md (easy_fp_constant): Remove special
>         -ffast-math handling that kept non-0 constants live in the RTL
>         until reload.  Remove logic testing the number of instructions it
>         took to create a constant in a GPR that was never used, due to a
>         test for soft-float earlier.
>         (memory_fp_constant): Delete, no longer used.
>
>         * config/rs6000/rs6000.md (mov<MODE>_hardfloat): Remove
>         alternatives for loading non-0 constants into GPRs for hard
>         floating point that is no longer needed due to changes in
>         easy_fp_constant.  Add support for loading 0.0 into GPRs.
>         (mov<mode>_hardfloat32): Likewise.
>         (mov<mode>_hardfloat64): Likewise.
>         (mov<mode>_64bit_dm): Likewise.
>         (movtd_64bit_nodm): Likewise.
>         (pre-reload move FP constant define_split): Delete define_split,
>         since it is no longer used.
>         (extenddftf2_internal): Remove GHF constraints that are not valid
>         for extenddftf2.
>
> [gcc/testsuite]
> 2015-03-17  Michael Meissner  <meissner@linux.vnet.ibm.com>
>
>         PR target/65240
>         * gcc/testsuite/g++.dg/pr65240.h: Add tests for PR 65240.
>         * gcc/testsuite/g++.dg/pr65240-1.C: Likewise.
>         * gcc/testsuite/g++.dg/pr65240-2.C: Likewise.
>         * gcc/testsuite/g++.dg/pr65240-3.C: Likewise.
>         * gcc/testsuite/g++.dg/pr65240-4.C: Likewise.
>
> --
> Michael Meissner, IBM
> IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
> email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797

  reply	other threads:[~2015-03-18 11:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 20:07 Michael Meissner
2015-03-06 12:05 ` Richard Biener
2015-03-09 15:59   ` Michael Meissner
2015-03-11 17:02 ` David Edelsohn
2015-03-11 22:21   ` Michael Meissner
2015-03-12  0:52     ` David Edelsohn
2015-03-12 15:30       ` Michael Meissner
2015-03-12 15:37         ` David Edelsohn
2015-03-17 23:19           ` Michael Meissner
2015-03-18 11:08             ` Richard Biener [this message]
2015-03-20 17:44               ` Michael Meissner
2015-04-04 18:25             ` Andreas Schwab
2015-04-04 23:07               ` Alan Modra

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=CAFiYyc0qLRYMwR5Omz9UOWixw3mdEp79pkz9jMvOymPH-pmBVQ@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=meissner@linux.vnet.ibm.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).