[Mesa-dev] [PATCH 3/3] nir: Rewrite lower_regs_to_ssa to use the phi builder

Jason Ekstrand jason at jlekstrand.net
Fri Dec 16 02:29:30 UTC 2016


On Dec 15, 2016 3:08 PM, "Eric Anholt" <eric at anholt.net> wrote:

Jason Ekstrand <jason at jlekstrand.net> writes:

> This keeps some of Connor's original code.  However, while I was at it,
> I updated this very old pass to a bit more modern NIR.

I love how much smaller this code is.  Assuming that the phi builder
does that job correctly, this is pretty trivial to read and understand.


The bigger vars_to_ssa has been using the phi builder for some time now and
it's handled everything we've ever thrown at it.

The only things I saw were:

- It doesn't call nir_metadata_preserve() like the old pass did, while
  it adds new SSA values.  Seems like it should.


Yup.   I'll get that fixed.

- It asserts that reg->num_array_elems == 0, while the old pass would
  just skip those.  It looks like the only source of arrays would be
  nir_lower_locals_to_regs(), which only i965 is calling.  Is that
  something we should be using?  Should we be handling the array reg
  case in this pass and in our drivers?


I've got a patch for that.  I needed it for my hack testing.  I'll as it to
the pass.  Incidentally, I don't think the old pass handles either of those
correctly, it just assumed everything was a "normal" register.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161215/98e046e2/attachment-0001.html>


More information about the mesa-dev mailing list