<p dir="ltr"><br>
On Jun 1, 2015 3:20 AM, "Pohjolainen, Topi" <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>> wrote:<br>
><br>
> On Fri, May 22, 2015 at 02:24:50PM -0400, Connor Abbott wrote:<br>
> > Signed-off-by: Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>><br>
> > ---<br>
> >  src/glsl/nir/nir.h               | 4 ++--<br>
> >  src/glsl/nir/nir_instr_compare.c | 8 ++++----<br>
> >  2 files changed, 6 insertions(+), 6 deletions(-)<br>
> ><br>
> > diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h<br>
> > index e3b7b17..19b1e18 100644<br>
> > --- a/src/glsl/nir/nir.h<br>
> > +++ b/src/glsl/nir/nir.h<br>
> > @@ -1578,8 +1578,8 @@ bool nir_foreach_dest(nir_instr *instr, nir_foreach_dest_cb cb, void *state);<br>
> >  bool nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state);<br>
> ><br>
> >  nir_const_value *nir_src_as_const_value(nir_src src);<br>
> > -bool nir_srcs_equal(nir_src src1, nir_src src2);<br>
> > -bool nir_instrs_equal(nir_instr *instr1, nir_instr *instr2);<br>
> > +bool nir_srcs_equal(const nir_src src1, const nir_src src2);<br>
> > +bool nir_instrs_equal(const nir_instr *instr1, const nir_instr *instr2);<br>
> >  void nir_instr_rewrite_src(nir_instr *instr, nir_src *src, nir_src new_src);<br>
> >  void nir_instr_move_src(nir_instr *dest_instr, nir_src *dest, nir_src *src);<br>
> >  void nir_if_rewrite_condition(nir_if *if_stmt, nir_src new_src);<br>
> > diff --git a/src/glsl/nir/nir_instr_compare.c b/src/glsl/nir/nir_instr_compare.c<br>
> > index 89b576c..07d0031 100644<br>
> > --- a/src/glsl/nir/nir_instr_compare.c<br>
> > +++ b/src/glsl/nir/nir_instr_compare.c<br>
> > @@ -30,7 +30,7 @@<br>
> >  #include "nir.h"<br>
> ><br>
> >  bool<br>
> > -nir_srcs_equal(nir_src src1, nir_src src2)<br>
> > +nir_srcs_equal(const nir_src src1, const nir_src src2)<br>
><br>
> You could even make them constant references and avoid the automatic<br>
> copy. With that:</p>
<p dir="ltr">This is C not C++.  But, that goes to show that adding comet to these doesn't really help anything.</p>
<p dir="ltr">Constifying nir_instrs_equal is</p>
<p dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>></p>
<p dir="ltr">> Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
><br>
> >  {<br>
> >     if (src1.is_ssa) {<br>
> >        if (src2.is_ssa) {<br>
> > @@ -58,8 +58,8 @@ nir_srcs_equal(nir_src src1, nir_src src2)<br>
> ><br>
> ><br>
> >  static bool<br>
> > -nir_alu_srcs_equal(nir_alu_instr *alu1, nir_alu_instr *alu2, unsigned src1,<br>
> > -                   unsigned src2)<br>
> > +nir_alu_srcs_equal(const nir_alu_instr *alu1, const nir_alu_instr *alu2,<br>
> > +                   unsigned src1, unsigned src2)<br>
> >  {<br>
> >     if (alu1->src[src1].abs != alu2->src[src2].abs ||<br>
> >         alu1->src[src1].negate != alu2->src[src2].negate)<br>
> > @@ -74,7 +74,7 @@ nir_alu_srcs_equal(nir_alu_instr *alu1, nir_alu_instr *alu2, unsigned src1,<br>
> >  }<br>
> ><br>
> >  bool<br>
> > -nir_instrs_equal(nir_instr *instr1, nir_instr *instr2)<br>
> > +nir_instrs_equal(const nir_instr *instr1, const nir_instr *instr2)<br>
> >  {<br>
> >     if (instr1->type != instr2->type)<br>
> >        return false;<br>
> > --<br>
> > 2.1.0<br>
> ><br>
> > _______________________________________________<br>
> > mesa-dev mailing list<br>
> > <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> > <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</p>