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

Jyotsna Verma jverma at codeaurora.org
Sun Sep 30 21:16:27 PDT 2012


> > For Example:
> > def getPredOpcode : InstrMapping {
> >  let FilterClass = "PredRel";
> >    let RowFields = ["BaseOpcode"];
> >    let ColFields = ["PredSense"];
> >    let KeyCol = ["none"];
> >    let ValueCols = [["true"], ["false"]]; }
> >
> > Here, only instructions that have "none" as PredSense will be selected
> > as key instructions.
> >
> > 4) For each key instructions, we form a small group of instructions
> > which have the same values as the key instruction for all the fields
> > listed in RowFields.
> 
> OK, please avoid using a quadratic algorithm to do that.

I have tried to come up with an alternative algorithm but I couldn't think
of any. If you have any ideas, I would like to hear them.

> 
> > I don't know what you mean by the full backend. I'm not adding any new
> > TableGen option/flag for this functionality. I have just added the
> > functionality in a separate file and emit  output in GenInstrInfo.inc
> > file as you suggested. I call it after EmitInstrInfo function from
> > TableGen.cpp like this:
> 
> I see. I don't really understand the purpose of the MapTableEmitter class,
> then. There is very little class state, and you're passing a lot of
context
> around as function arguments.

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. 

Regards,
Jyotsna




More information about the llvm-commits mailing list