This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] sched: Do not move expensive insns speculatively (PR68664)
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 26 Jan 2017 19:19:06 -0600
- Subject: Re: [RFC] sched: Do not move expensive insns speculatively (PR68664)
- Authentication-results: sourceware.org; auth=none
- References: <9a0c95d7ab2d7c5532b51b898acae2ef8f756aa9.1485477070.git.segher@kernel.crashing.org> <CA+=Sn1nWXo_QEtmzt-gwiRJHyxS4YDpqy6N1nMyR=+=JzYF6Qw@mail.gmail.com>
On Thu, Jan 26, 2017 at 05:00:44PM -0800, Andrew Pinski wrote:
> On Thu, Jan 26, 2017 at 4:38 PM, Segher Boessenkool
> <segher@kernel.crashing.org> wrote:
> > Scheduling should never move very expensive instructions to places they
> > are executed more frequently. This patch fixes that, reducing the
> > execution time of c-ray by over 40% (I tested on a BE Power7 system).
> >
> > Is there some existing way to test for "very expensive insn" or "very
> > expensive insn we should not speculate"? Should there be a new hook?
> > Is only disallowing (FP) SQRT and DIV a good solution?
>
> Seems like it should be checking the insn cost and compare that
> against some parameter. That is possibly set by the target if needed.
But what is "insn cost"? Latency is no good at all -- we *want* insns
with higher latency to be earlier. fsqrt is not pipelined, and that is
what makes it so costly. (This isn't modeled in the scheduling
description btw: that would make the automata sizes explode, the usual
problem).
Segher