This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] sched: Do not move expensive insns speculatively (PR68664)


On Fri, Jan 27, 2017 at 1:38 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> 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 ;-)

Well, the testcase as written doesn't but if you speculate the sqrt it might?

> 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.

I understood that but then moving sth inside a loop is almost never a win.

Can't "not modeled" insns not be marked somehow in the pipeline description?

Richard.

>
>
> Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]