[Mesa-dev] [RFC 0/9] Use linked lists for use/def sets in NIR

Jason Ekstrand jason at jlekstrand.net
Fri Apr 24 16:31:57 PDT 2015


This patch series is an experiment that I ran this week to see what would
happen if we used a linked list instead of a hash set for use/def sets in
NIR.  The first 5 patches are cleanups that we probably want anyway.  The
6th adds a C-based linked list to NIR. The last 3, which need to be
squashed together, actually make the change to linked lists.  I'll let you
read the commit messages on 6 and 7 for the important details there.

Jason Ekstrand (9):
  nir/validate: Validate SSA def parent instructiosn
  nir: Modernize the out-of-SSA pass
  nir: Add and use initializer #defines for nir_src and nir_dest
  nir: Add a function for rewriting the condition of an if statement
  nir: Use nir_instr_rewrite_src in copy propagation
  nir: Add an entirely C-based linked list implementation
  nir/nir: Use a linked list instead of a has set for use/def sets
  SQUASH: nir: Add a helper for moving a source and use it in texture
    lowering
  SQUASH: nir: Update various components for the new list-based use/def
    sets

 src/glsl/Makefile.sources               |   1 +
 src/glsl/nir/glsl_to_nir.cpp            |   2 +-
 src/glsl/nir/nir.c                      | 230 ++++++++++++++------------------
 src/glsl/nir/nir.h                      |  40 ++++--
 src/glsl/nir/nir_builder.h              |   6 +-
 src/glsl/nir/nir_from_ssa.c             | 142 +++++---------------
 src/glsl/nir/nir_list.h                 | 183 +++++++++++++++++++++++++
 src/glsl/nir/nir_lower_locals_to_regs.c |  14 +-
 src/glsl/nir/nir_lower_samplers.cpp     |  30 +++--
 src/glsl/nir/nir_lower_tex_projector.c  |  12 +-
 src/glsl/nir/nir_lower_to_source_mods.c |  20 +--
 src/glsl/nir/nir_lower_vars_to_ssa.c    |   3 +-
 src/glsl/nir/nir_opt_copy_propagate.c   |  71 ++--------
 src/glsl/nir/nir_opt_gcm.c              |  14 +-
 src/glsl/nir/nir_opt_global_to_local.c  |  13 +-
 src/glsl/nir/nir_opt_peephole_ffma.c    |   9 +-
 src/glsl/nir/nir_opt_peephole_select.c  |  10 +-
 src/glsl/nir/nir_search.c               |   2 +-
 src/glsl/nir/nir_to_ssa.c               |  19 +--
 src/glsl/nir/nir_validate.c             | 160 +++++++++++-----------
 20 files changed, 518 insertions(+), 463 deletions(-)
 create mode 100644 src/glsl/nir/nir_list.h

-- 
2.3.6



More information about the mesa-dev mailing list