[Mesa-dev] Mesa (master): glsl2: Add pass to remove redundant jumps

Eric Anholt eric at anholt.net
Sun Sep 19 00:45:36 PDT 2010


On Tue, 14 Sep 2010 03:55:06 +0200, Luca Barbieri <luca at luca-barbieri.com> wrote:
> ir_lower_jumps should already do the jump unification, and
> could/should also remove the continue.
> It's probably best to put all jump manipulations there to avoid
> risking rerunning all passes a number of times linear in the program
> size.
> 
> Regarding ifs, it would be nice to also remove empty else branches,
> and possibly convert if(c) {} else {code()} to if(!c) {code()} or

I remember writing the code to do that, but now I don't see it anywhere.
It should happen in ir_if_simplification, I think.

> perhaps do the reverse canonicalization instead.
> And also things like "if(c) {if(c) {code()}}" to if(c) {code()}

We don't have anything for handling constraints on values, and it would
be nice if we did.

> as well as "if(1) {code()}" to "code()",

That's in ir_if_simplification.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100919/01566689/attachment-0001.pgp>


More information about the mesa-dev mailing list