[Mesa-dev] [PATCH] r600/sb: Force ELSE path if the byte code started off with it

Dave Airlie airlied at gmail.com
Mon Jan 29 20:33:29 UTC 2018


On 30 January 2018 at 06:25, Gert Wollny <gw.fossdev at gmail.com> wrote:
> Am Montag, den 29.01.2018, 20:32 +0100 schrieb Roland Scheidegger:
>>
>> Am I correct assuming that for something like
>>    while (foo) {
>>       if (bar) {
>>          do something;
>>       } else {
>>          /* nothing */
>>       }
>>    }
>> The else clause wouldn't get optimized away neither?
>> (This of course is a trivial example, but I suppose it would extend
>> to cases where the optimizer actually optimized away the alu
>> instructions in the else clause).
>> In this case, this indeed looks rather harsh.
> This is indeed the case (unless the if is eliminated completely in the
> if_conversion).
>
>> I would have said in theory somehow the break should be some op which
>> (despite not having a dst) has side-effects so it would not be
>> subject to elimination somewhere (as there would be a if->next node
>> in this case then).
> It is the else that vanishes, but only if there is only a break in the
> else path, if there there is also an ALU clause, then the else branch
> is created propperly.
>
>> Albeit I'm completely oblivious how it really gets optimized away, is
>> that based on liveness analysis or something? The sb code is a
>> mystery to me...
> I'm trying to understand it, but is is very dificult to grasp how it
> works even with the debugging output. Well, maybe Dave has a better
> idea.
>

I'm reading the paper the whole depart region stuff is based on today,
maybe I'll come out enlightened or more confused.

Dave.


More information about the mesa-dev mailing list