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: [PATCH] sched: Do not move expensive insns speculatively (PR68664)


On Fri, Feb 03, 2017 at 06:28:21PM -0600, Segher Boessenkool wrote:
> On Fri, Feb 03, 2017 at 04:31:58PM -0700, Jeff Law wrote:
> > >+@deftypefn {Target Hook} bool TARGET_SCHED_CAN_SPECULATE_INSN (rtx_insn 
> > >*@var{insn})
> > >+Some instructions should never be speculated by the schedulers, usually
> > >+ because the instruction is too expensive to get this wrong.  This hook
> > >+ should return @code{false} if @var{insn} should not be speculated.
> > >+@end deftypefn
> > Consider adding something like this:
> > 
> > Define this hook to return false for instructions which are not fully 
> > modeled by the pipeline description to avoid DFA size explosion. 
> > Otherwise the scheduler may erroneously speculate those instructions 
> > into a pipeline bubble that is too small which may severely impact 
> > performance.
> 
> Well, it speculates it even _if_ you correctly model it, currently
> anyway.  But I'll write something similar, good idea.

This is what I committed:

+DEFHOOK
+(can_speculate_insn,
+ "Some instructions should never be speculated by the schedulers, usually\n\
+ because the instruction is too expensive to get this wrong.  Often such\n\
+ instructions have long latency, and often they are not fully modeled in the\n\
+ pipeline descriptions.  This hook should return @code{false} if @var{insn}\n\
+ should not be speculated.",
+ bool, (rtx_insn *insn), hook_bool_rtx_insn_true)


Segher


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