<div dir="ltr"><div class="gmail_quote">On Fri, May 22, 2015 at 9:13 PM Andrew Trick <<a href="mailto:atrick@apple.com">atrick@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On May 22, 2015, at 8:39 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>> wrote:<br>
><br>
> ----- Original Message -----<br>
>> From: "Paweł Bylica" <<a href="mailto:chfast@gmail.com" target="_blank">chfast@gmail.com</a>><br>
>> To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>><br>
>> Cc: "LLVMdev" <<a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a>>, "Jonas Paulsson" <<a href="mailto:jonas.paulsson@ericsson.com" target="_blank">jonas.paulsson@ericsson.com</a>><br>
>> Sent: Friday, May 22, 2015 9:19:14 AM<br>
>> Subject: Re: [LLVMdev] Problems with instruction scheduling<br>
>><br>
>><br>
>><br>
>> On Fri, May 22, 2015 at 4:09 PM Hal Finkel < <a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a> > wrote:<br>
>><br>
>><br>
>> ----- Original Message -----<br>
>>> From: "Paweł Bylica" < <a href="mailto:chfast@gmail.com" target="_blank">chfast@gmail.com</a> ><br>
>>> To: "LLVMdev" < <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a> ><br>
>>> Sent: Friday, May 22, 2015 8:45:11 AM<br>
>>> Subject: Re: [LLVMdev] Problems with instruction scheduling<br>
>>><br>
>>><br>
>>><br>
>>> Any comments?<br>
>><br>
>> Not in particular, but I think we're pretty close to applying a<br>
>> rewrite by Jonas Paulsson (cc'd). If you can't find the discussions<br>
>> on the mailing list, please let us know.<br>
>><br>
>> -Hal<br>
>><br>
>><br>
>><br>
>> Thanks for the response.<br>
>><br>
>><br>
>> Do you mean "ScheduleDAGInstrs::buildSchedGraph() rewritten"<br>
>> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D8705&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=YkA639_4weGN8PORlIfvMaMH2rDAFxBzcXePI2ODOrU&s=gzYkwVJTvh_3NnFmpwCSiwPdm58DQE4VWetzTHsJRIA&e=" target="_blank">http://reviews.llvm.org/D8705</a> ? If yes it is not the same fragment<br>
>> of code.<br>
<br>
It looks like I had a trivial request for code organization, otherwise that patch is probably fine. It’s unrelated to the thread though.<br>
<br>
> Ah, I see. That bug deals with ScheduleDAGRRList.<br>
><br>
> Andy, I thought that with the transition to source-order SDAG scheduling (and using MI scheduling instead), we were going to essentially get rid of that code. Is that right?<br>
<br>
<br>
Right, Pawel’s bug is in SDAG scheduling. I would like this to go away, but the reality is that unless you use fast-isel, you still rely on this algorithm to serialize the DAG and resolve physical register interferences, usually when a flag-producing instruction like ADD or CMP feeds multiple uses, like ADC or CMOVE for example. There is some nasty backtracking happening to handle this full of rarely touched corner cases—it’s been problematic for a long time with larger-than-legal IR types.<br>
<br>
I hoped most of these problems would go away with Pawel’s fix for PR22304. It looks like he’s hitting another one, and I haven’t had time to step through the scheduler trace. It’s just a matter of figuring out how that code gets stuck in a corner and can’t get out. I don’t have any special power for doing this, as I have to reparse the code each time I look at it. I will say that there should be a way for the code to get unstuck by spilling EFLAGS; see InsertCopiesAndMoveSuccs.<br></blockquote><div><br></div><div>I identified the cause of the problem. LiveRegGen entry is replaced at some point during unscheduling. And later LiveRegGen does not clear out as it should. I just turned off this replacement.</div><div><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D9993&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=YkA639_4weGN8PORlIfvMaMH2rDAFxBzcXePI2ODOrU&s=lcQbqY0Bo9w3F-FA-8l-AVEfW4XLPH5V3gAWFzAlHQg&e=">http://reviews.llvm.org/D9993</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A workaround could be to disable select->cmov generation in certain situations (EmitLoweredSelect?).<br>
<br>
Andy<br>
<br>
> -Hal<br>
><br>
>><br>
>><br>
>> - Paweł<br>
>><br>
>><br>
>>><br>
>>><br>
>>> On Thu, May 21, 2015 at 4:05 PM Paweł Bylica < <a href="mailto:chfast@gmail.com" target="_blank">chfast@gmail.com</a> ><br>
>>> wrote:<br>
>>><br>
>>><br>
>>><br>
>>> Hi,<br>
>>><br>
>>><br>
>>> I'm trying to fix PR23405 - assert failure during instruction<br>
>>> scheduling in llc. I have related but more generic questions.<br>
>>><br>
>>><br>
>>> Is there any higher level description of the algorithm used for<br>
>>> instruction scheduling in this case? It is new area for me and I<br>
>>> would love to see bigger picture.<br>
>>><br>
>>><br>
>>> My currently smallest test case contains 90 DAG nodes. I got it by<br>
>>> manually reducing IR previously reduced by bugpoint. Is there a way<br>
>>> to reduce it more, maybe on DAG level? Identifying the part of the<br>
>>> DAG that causes the problem could be helpful.<br>
>>><br>
>>><br>
>>><br>
>>> - Paweł<br>
>>> _______________________________________________<br>
>>> LLVM Developers mailing list<br>
>>> <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
>>><br>
>><br>
>> --<br>
>> Hal Finkel<br>
>> Assistant Computational Scientist<br>
>> Leadership Computing Facility<br>
>> Argonne National Laboratory<br>
>><br>
><br>
> --<br>
> Hal Finkel<br>
> Assistant Computational Scientist<br>
> Leadership Computing Facility<br>
> Argonne National Laboratory<br>
<br>
</blockquote></div></div>