[Mesa-dev] [PATCH] nir: clone instruction set rather than removing individual entries
Jason Ekstrand
jason at jlekstrand.net
Thu Feb 21 14:47:51 UTC 2019
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
On Thu, Feb 21, 2019 at 5:33 AM Thomas Helland <thomashelland90 at gmail.com>
wrote:
> This patch is:
>
> Reviewed-by: Thomas Helland<thomashelland90 at gmail.com>
>
> Den ons. 20. feb. 2019 kl. 04:04 skrev Timothy Arceri <
> tarceri at itsqueeze.com>:
> >
> > This reduces the time spent in nir_opt_cse() by almost a half.
> > ---
> > src/compiler/nir/nir_opt_cse.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/compiler/nir/nir_opt_cse.c
> b/src/compiler/nir/nir_opt_cse.c
> > index bf42a6a33dc..3c3617d852a 100644
> > --- a/src/compiler/nir/nir_opt_cse.c
> > +++ b/src/compiler/nir/nir_opt_cse.c
> > @@ -39,9 +39,10 @@
> > */
> >
> > static bool
> > -cse_block(nir_block *block, struct set *instr_set)
> > +cse_block(nir_block *block, struct set *dominance_set)
> > {
> > bool progress = false;
> > + struct set *instr_set = _mesa_set_clone(dominance_set, NULL);
> >
> > nir_foreach_instr_safe(instr, block) {
> > if (nir_instr_set_add_or_rewrite(instr_set, instr)) {
> > @@ -55,8 +56,7 @@ cse_block(nir_block *block, struct set *instr_set)
> > progress |= cse_block(child, instr_set);
> > }
> >
> > - nir_foreach_instr(instr, block)
> > - nir_instr_set_remove(instr_set, instr);
> > + _mesa_set_destroy(instr_set, NULL);
> >
> > return progress;
> > }
> > --
> > 2.20.1
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190221/3a7f35be/attachment.html>
More information about the mesa-dev
mailing list