[Mesa-dev] GLSL compiler function call cleaning
kenneth at whitecape.org
Wed Mar 28 20:32:59 PDT 2012
I finally resurrected this work I started back in September. I think
I've included most of the old feedback, and done a bunch more cleaning.
This series changes ir_call from a value (which can be nested inside
expression trees) to a statement which can only appear in the instruction
stream. This makes expression trees pure (free from side-effects), which
ought to make optimization passes easier to write and less error-prone.
It also resolves the ugliness where ir_call was the _only_ ir_rvalue
that could appear in an instruction stream, which was bizarre.
It also includes some AST->IR clean-ups, because...well. It was a mess.
The one outstanding concern I have is IR->Mesa and IR->TGSI: both seem
to support function calls, but I'm not sure how that all works. IMHO
Mesa IR really shouldn't support them---we should just rely on the GLSL
compiler's inliner. I'm incredibly skeptical that the code in IR->Mesa
actually works, since it has a comment that functions other than main()
should never been seen. Maybe that's just old. Can we delete this?
I suspect IR->TGSI needs to support real function calls. The code there
still compiles, but it probably breaks. I probably need help adapting it.
No piglit regressions on i965. Nothing else was tested.
More information about the mesa-dev