On Mon, Apr 27, 2015 at 1:35 PM, Connor Abbott <cwabbo...@gmail.com> wrote: > On Fri, Apr 24, 2015 at 7:32 PM, Jason Ekstrand <ja...@jlekstrand.net> wrote: >> +struct nir_if; >> + >> typedef struct nir_src { >> union { >> + nir_instr *parent_instr; >> + struct nir_if *parent_if; >> + }; > > There's something I'm not quite understanding about this... how are we > supposed to know which of parent_instr and parent_if are valid? If I > walk over all the sources for a given SSA def or register, how am I > supposed to know if it's part of an if-condition or an instruction? I > would think that you would need a boolean here or have parent_instr > and parent_if not be in a union.
We do the same thing we did with the sets before. We have separate uses and if_uses sets. If it's in if_uses, you use the if. If it's in uses, it's an instr. We could put something in the source but that seems like it'll make for even more mess. --Jason _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev