[Mesa-dev] [PATCH 0/2] Nir: Allow CSE of SSBO loads

Iago Toral Quiroga itoral at igalia.com
Thu Oct 22 04:21:17 PDT 2015


I implemented this first as a separate optimization pass in GLSL IR [1], but
Curro pointed out that this being pretty much a restricted form of a CSE pass
it would probably make more sense to do it inside CSE (and we no longer have
a CSE pass in GLSL IR).

Unlike other things we CSE in NIR, in the case of SSBO loads we need to make
sure that we invalidate previous entries in the set in the presence of
conflicting instructions (i.e. SSBO writes to the same block and offset) or
in the presence of memory barriers.

If this is accepted I intend to extend this to also cover image reads, which
follow similar behavior.

No regressions observed in piglit or dEQP's SSBO functional tests.

[1] http://lists.freedesktop.org/archives/mesa-dev/2015-October/097718.html

Iago Toral Quiroga (2):
  nir/cse: invalidate SSBO loads in presence of ssbo writes or memory
    barriers
  nir/instr_set: allow rewrite of SSBO loads

 src/glsl/nir/nir_instr_set.c |  24 ++++++--
 src/glsl/nir/nir_opt_cse.c   | 142 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 162 insertions(+), 4 deletions(-)

-- 
1.9.1



More information about the mesa-dev mailing list