[llvm-commits] [PATCH] TableGen backend support to express relations between instruction

Jyotsna Verma jverma at codeaurora.org
Mon Oct 1 12:28:12 PDT 2012


 
> Make one scan over the instructions, using the column fields to determine
> which column the instruction belongs to, if any. Build a map that is keyed
by
> the values of the row fields, and with values that are vectors of Records:
> 
>  Map (RowVal1, RowVal2, .) --> [KeyCol, Val1Col, Val2Col, .]
> 
> While doing this, you can collect the KeyCol records, like you are doing
now.
> 
> One the second pass over the KeyCol records, you can look up the
> corresponding records in the map.
>

Thanks Jakob!
I thought about it too but discarded the idea since it needed a map which
could store a combination of fields as Key. If  std::multimap works, then it
can be easily done.
 
> > I wanted to abstract all the functionality required for Instruction
> > Mapping at one place. You are right about the class having very little
state.
> > However, since the dataset I'm operating on is changing for each
> > iteration, it didn't make sense to store it inside the class.
> 
> Instead of having effectively a singleton class, create a new instance for
each
> table you're building. Then you can have all the context variables as
> members.

I need to think about it a bit.  I will get back to you later.

-Jyotsna






More information about the llvm-commits mailing list