[Mesa-dev] [PATCH] r600/sb: Force ELSE path if the byte code started off with it
Gert Wollny
gw.fossdev at gmail.com
Mon Jan 29 20:25:48 UTC 2018
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.
Best,
Gert
More information about the mesa-dev
mailing list