From: Marek O. <ma...@gm...> - 2010-03-31 02:34:58
|
On Tue, Mar 30, 2010 at 10:26 AM, Nicolai Haehnle <nha...@gm...>wrote: > On Tue, Mar 30, 2010 at 8:13 AM, Marek Olšák <ma...@gm...> wrote: > > Another idea was to convert TGSI to a SSA form. That would make unrolling > > branches much easier as the Phi function would basically become a linear > > interpolation, loops and subroutines with conditional return statements > > might be trickier. The r300 compiler already uses SSA for its > optimization > > passes so maybe you wouldn't need to mess with TGSI that much... > > Note that my Git repository already contains an implementation of > branch emulation and some additional optimizations, see here: > http://cgit.freedesktop.org/~nh/mesa/log/?h=r300g-glsl<http://cgit.freedesktop.org/%7Enh/mesa/log/?h=r300g-glsl> > > Shame on me for abandoning it - I should really get around to make > sure it fits in with recent changes and merge it to master. The main > problem is that it produces "somewhat" inefficient code. Adding and > improving peephole and similar optimizations should help tremendously. > Well it's either this or nothing so I guess I am not the only one to prefer to get it merged. ;) However that kinda slightly changes Tom's plan for the GSoC project. On a different note, considering that the r300 compiler has basically 2 frontends (Mesa IR and TGSI) and 3 backends (r300 VS & FS, r500 FS), would it be feasible to add yet another backend - TGSI? That would turn the compiler into a generic Gallium shader optimizer with the lowering tools it already has (or will have) and more people would be interested in adding new features and improvements in it. -Marek |