I'm pretty sure this is one of the optimizations (but not the only) enabled for radeon by setting R600_DEBUG=sb on r600g.
Yes, r600g/sb has an if-conversion pass that produces the same result for the IF-MOV-ELSE-MOV-ENDIF pattern, though it's a bit more generic and handles almost any suitable conditional code, e.g. with more than one MOV in each branch, other instructions, nested IFs, etc.
Originally Posted by smitty3268
So, judging by that, it's unlikely to make much difference on the benchmarks michael runs, but can be very big on real applications like the Source games or WINE.
Many apps in Michael's benchmarks don't use shaders with conditional control flow at all, in such cases these optimizations have nothing to work on.
It lives in src/glsl, while the drivers live under src/mesa/drivers and src/gallium/drivers. Having this kind of simplification in the GLSL compiler would be in one place, instead of duplicated in every driver.