<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jun 6, 2018 at 2:33 PM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
<br>
nir_ssa_def::parent_instr and nir_src::parent_instr have the same name,<br>
but they mean really different things.  I choose to save the next person<br>
the hour+ that I just spent figuring that out.  Even now that I know, I<br>
doubt I'd notice in code review that someone typed foo->parent_instr<br>
when they actually meant foo->ssa->parent_instr.<br>
<br>
Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
---<br>
 src/compiler/nir/nir.h | 2 ++<br>
 1 file changed, 2 insertions(+)<br>
<br>
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h<br>
index 5a1f79515ad..ba2a7142aa0 100644<br>
--- a/src/compiler/nir/nir.h<br>
+++ b/src/compiler/nir/nir.h<br>
@@ -490,6 +490,7 @@ typedef struct nir_ssa_def {<br>
    /** Index into the live_in and live_out bitfields */<br>
    unsigned live_index;<br>
<br>
+   /** Instruction whose result is this SSA value. */<br></blockquote><div><br></div><div>Maybe "which produces this SSA value"?  I don't know if that's better.  Either way, documentation is good. :)</div><div><br></div><div>Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    nir_instr *parent_instr;<br>
<br>
    /** set of nir_instrs where this register is used (read from) */<br>
@@ -529,6 +530,7 @@ struct nir_if;<br>
<br>
 typedef struct nir_src {<br>
    union {<br>
+      /** Instruction that consumes this value as a source. */<br>
       nir_instr *parent_instr;<br>
       struct nir_if *parent_if;<br>
    };<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.14.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>