[llvm-commits] [PATCH] TableGen backend support to express relations between instruction
Jyotsna Verma
jverma at codeaurora.org
Mon Oct 1 08:52:56 PDT 2012
Hello Jakob,
Here is the updated patch which includes a new section into
docs/WritingAnLLVMBackend.html and a high-level description of the algorithm
in CodeGenMapTable.cpp file.
Thanks,
Jyotsna
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
The Linux Foundation
> -----Original Message-----
> From: Jakob Stoklund Olesen [mailto:stoklund at 2pi.dk]
> Sent: Friday, September 28, 2012 4:42 PM
> To: Jyotsna Verma
> Cc: llvm-commits at cs.uiuc.edu
> Subject: Re: [llvm-commits] [PATCH] TableGen backend support to express
> relations between instruction
>
>
> On Sep 28, 2012, at 12:22 PM, Jyotsna Verma <jverma at codeaurora.org>
> wrote:
>
> > Jakob,
> >
> >> In find the code very hard to read without a high-level description
> >> of
> > what it
> >> is supposed to do and how it is supposed to be used. Don't assume
> >> whoever reads the code has read any of the mailing list threads.
> >
> > I can understand that. I will include some description in the .cpp file.
>
> Thanks.
> >
> > 1) Iterate through all the records that derive from "InstrMapping"
> > class
> > 2) For each record, we filter out instructions based on the
> > FilterClass value.
> > 3) Among this set, we look for the instructions that have the same
> > values as KeyCol for all the fields listed in ColFields. These are
> > identified as the potential candidates for key instructions. Some of
> > these instructions may be dropped if their corresponding column
> > instruction is not found. In case of multi-column relation, the
> > instruction is removed if none of the relations are found.
> >
> > 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 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.
>
> /jakob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-TableGen-support-to-create-relationship-maps-bet.patch
Type: application/octet-stream
Size: 40047 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121001/cfb98c01/attachment.obj>
More information about the llvm-commits
mailing list