[LLVMdev] Preferential treatment of labels in MI sched DAG construction

Andrew Trick atrick at apple.com
Mon Feb 11 13:22:53 PST 2013


On Feb 11, 2013, at 1:03 PM, Sergei Larin <slarin at codeaurora.org> wrote:

> Hi Andy,
> 
>  I have to resurrect an ancient question regarding scheduling boundaries.
> 
> You might remember the reason for introduction of CanHandleTerminators to
> ScheduleDAGInstrs. In short, Hexagon is currently uses DAG construction
> method (buildSchedGraph) for several purposes, which includes region
> formation for general VLIW packetization/bundling. As such we need to handle
> pretty much all instructions and any terminators, including labels (though I
> know it sounds strange). Nevertheless, ScheduleDAGInstrs::buildSchedGraph
> still has this hard assert in it:
> 
> assert((!MI->isTerminator() || CanHandleTerminators) && !MI->isLabel() &&
>           "Cannot schedule terminators or labels!");
> 
> ...and we have been OK till now by simply disabling it in our local version
> of the code, but since we are now working towards upstreaming all our code,
> this could no longer be ignored.
> 
>  I guess my proposal is not to treat labels differently from any other
> terminator - if a target wants to "schedule" labels - let it do so. It
> actually works just fine for Hexagon... so if we can change this assert to
> something like:
> 
> 
> assert((!MI->isTerminator() || CanHandleTerminators) && "Cannot schedule
> terminators or labels!");
> 
>  It would equal label in rights with any other terminator. What do you
> think?

Sure, as long as CanHandleTerminators is commented to that effect.

-Andy



More information about the llvm-dev mailing list