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

Dave Airlie airlied at gmail.com
Tue Jan 30 05:47:24 UTC 2018

On 30 Jan. 2018 3:35 pm, "Dave Airlie" <airlied at gmail.com> wrote:

On 30 January 2018 at 06:33, Dave Airlie <airlied at gmail.com> wrote:
> 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.

I'm more confused, but I've attached a patch that I think works, but I'm not
sure it doesn't blow up the world, and I have to head off now.

I think this may need to check repdep1 region is not the same as the
overall region we are processing, or maybe it just needs to check if it's a


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180130/df5c178f/attachment.html>

More information about the mesa-dev mailing list