[Mesa-dev] [PATCH 4.5/7] nir: add list_head to nir_src::ssa

Rob Clark robdclark at gmail.com
Mon Oct 26 11:14:00 PDT 2015


On Mon, Oct 26, 2015 at 2:01 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Mon, Oct 26, 2015 at 8:26 AM, Rob Clark <robdclark at gmail.com> wrote:
>> From: Rob Clark <robclark at freedesktop.org>
>>
>> This will be used by clone.  Possibly useful elsewhere.  The list link
>> will only be valid in ssa case, it fits in the padding in the union
>> left from the larger nir_reg_src.
>
> We already have a use_link.  It seems perfectly reasonable to me to
> overload it in the middle of a copy operation.

I guess, only since we resolve src->ssa ptrs before
nir_add_defs_uses(), that could work..

BR,
-R


> --Jason
>
>> Signed-off-by: Rob Clark <robclark at freedesktop.org>
>> ---
>>  src/glsl/nir/nir.h | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
>> index 2d9c94c..fb60340 100644
>> --- a/src/glsl/nir/nir.h
>> +++ b/src/glsl/nir/nir.h
>> @@ -528,7 +528,12 @@ typedef struct nir_src {
>>
>>     union {
>>        nir_reg_src reg;
>> -      nir_ssa_def *ssa;
>> +      struct {
>> +         /* used in clone to track unresolved ssa src's: */
>> +         struct list_head link;
>> +
>> +         nir_ssa_def *ssa;
>> +      };
>>     };
>>
>>     bool is_ssa;
>> --
>> 2.5.0
>>


More information about the mesa-dev mailing list