[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 19:08:51 UTC 2016
On Thu, Dec 15, 2016 at 6:29 PM, Jason Ekstrand <jason at jlekstrand.net>
wrote:
> 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.
>
I just sent a v3 with all of the comments addressed. It's currently
running on Jenkins with a hack patch that, instead of just going out of
SSA, goes out of SSA completely, calls regs_to_ssa to go back in, and then
goes out of SSA as normal. I think it's pretty well tested now. :)
https://cgit.freedesktop.org/~jekstrand/mesa/commit/?h=jenkins_gl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161216/5b70f2a9/attachment.html>
More information about the mesa-dev
mailing list