[Mesa-dev] Suboptimal code generation

Ilia Mirkin imirkin at alum.mit.edu
Fri Nov 14 09:50:55 PST 2014


[changing subjects not to derail original discussion]

On Fri, Nov 14, 2014 at 12:25 PM, Henri Verbeet <hverbeet at gmail.com> wrote:
>> I strongly doubt that the performance increases are due
>> to better d3d9 bytecode -> TGSI conversion than -> glsl -> tgsi
>> conversion -- most serious backends (r600, radeonsi, nouveau) have
>> optimizing compilers that should take care of such issues.
>
> It was just an example, but at least in the past I've seen for example
> the translation for D3D cnd and cmp result in pretty sub-optimal code
> in r600g. In GLSL 1.30 and up mix() with a bool argument could perhaps
> make it easier for the driver to end up with something reasonable. But

I can't speak for the radeon guys, but I know I sure would love to see
any reports of poor code being generated by nouveau in response to
legitimate-seeming TGSI (or GLSL). In some cases, a simple
optimization can be added to take care of it, and I'd definitely
appreciate the extra pair of eyeballs on driver-generated code :)

The report can be as simple as "here is the TGSI snippet, take a look
at how crappy the code it generates is". At least for nouveau, I can
feed that directly into a compiler that can target any of the relevant
backends.

[Note, r600g didn't have an optimizer enabled until ~1y ago; not sure
if your analysis was with or without sb.]

Cheers,

  -ilia


More information about the mesa-dev mailing list