[Mesa-dev] [PATCH 5/6] nir/algebraic: Losten a restriction on variables
Jason Ekstrand
jason at jlekstrand.net
Mon Oct 22 23:29:10 UTC 2018
On Mon, Oct 22, 2018 at 6:28 PM Ian Romanick <idr at freedesktop.org> wrote:
> On 10/20/2018 11:01 AM, Jason Ekstrand wrote:
> > Previously, we would fail if a variable had an assigned but unknown bit
> > size X and we tried to assign it an actual bit size. However, this is
> > ok because, at the time we do the search, the variable does have an
> > actual bit size and it will match X because of the NIR rules.
> > ---
> > src/compiler/nir/nir_algebraic.py | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/compiler/nir/nir_algebraic.py
> b/src/compiler/nir/nir_algebraic.py
> > index 34ea2ba9e68..bcefa3372b3 100644
> > --- a/src/compiler/nir/nir_algebraic.py
> > +++ b/src/compiler/nir/nir_algebraic.py
> > @@ -352,8 +352,12 @@ class BitSizeValidator(object):
> > if var_class == 0:
> > self._var_classes[var.index] = bit_class
> > else:
> > - canon_class = self._class_relation.get_canonical(var_class)
> > - assert canon_class < 0 or canon_class == bit_class
> > + canon_bit_class = self._class_relation.get_canonical(var_class)
> > + canon_var_class = self._class_relation.get_canonical(bit_class)
>
> Are the _bit_ and _var_ names transposed in the left-hand side, or am I
> not understanding something? Or both? :)
>
Uh.... Oops... Fortunately, it doesn't matter since it's just used in this
check. I pushed this today with Samuel's review. I'll send out a fixup
patch.
--Jason
> > + assert canon_var_class < 0 or canon_bit_class < 0 or \
> > + canon_var_class == canon_bit_class, \
> > + 'Variable {0} cannot be both {1}-bit and {2}-bit' \
> > + .format(str(var), bit_class, var_class)
> > var_class = self._class_relation.add_equiv(var_class,
> bit_class)
> > self._var_classes[var.index] = var_class
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181022/b77009c7/attachment.html>
More information about the mesa-dev
mailing list