diff options
author | Kristian Høgsberg Kristensen <[email protected]> | 2015-12-14 17:44:23 -0800 |
---|---|---|
committer | Kristian Høgsberg Kristensen <[email protected]> | 2015-12-29 10:39:25 -0800 |
commit | f9283f2668bb1a64303d73b663464a8556fe3f8f (patch) | |
tree | 78aa7dc727e68567966a8e65b19916cc5af04bca /src/glsl/nir/nir_builder.h | |
parent | cddfc2cefa93b884c40329dcb193fe4fb22143ab (diff) |
nir: Teach nir_opt_algebraic about adding and subtracting the same thing
This optimizes a + b - b to just a. Modest shader-db results (BDW):
total instructions in shared programs: 7842452 -> 7841862 (-0.01%)
instructions in affected programs: 61938 -> 61348 (-0.95%)
total loops in shared programs: 2131 -> 2131 (0.00%)
helped: 263
HURT: 0
GAINED: 0
LOST: 0
but the optimization turns
gl_VertexID - gl_BaseVertexARB
into just a reference to SYSTEM_VALUE_VERTEX_ID_ZERO_BASE, which the
i965 hardware supports natively. That means we can avoid using the
internal vertex buffer for gl_BaseVertexARB in this case.
Reviewed-by: Eduardo Lima Mitev <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_builder.h')
0 files changed, 0 insertions, 0 deletions