[PATCH] TableGen CGIOperandList should use NumOutOperands instead of NumDefs

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 25 12:29:44 PST 2016


Hi Craig, 

Could you take a look at this? I looked at this last year, and I recall thinking that the underlying premise seems reasonable, but it does cause some changes in some of the X86 instruction definitions for some instructions with memory operands, and I'm not sure they're right. 

Thanks again, 
Hal 

----- Original Message -----

> From: "Aaron Shi (en ye)" <Aaronenye.Shi at amd.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: llvm-commits at lists.llvm.org, "Matt Arsenault"
> <arsenm2 at gmail.com>, "Matthew Arsenault"
> <Matthew.Arsenault at amd.com>, "Yaxun Liu (Sam)" <Yaxun.Liu at amd.com>,
> "Stanislav Mekhanoshin" <Stanislav.Mekhanoshin at amd.com>
> Sent: Wednesday, November 4, 2015 10:48:16 AM
> Subject: RE: [PATCH] TableGen CGIOperandList should use
> NumOutOperands instead of NumDefs

> Hi Hal,

> I have attached a new TableGen.patch correcting bool addToDefs =
> false; To be named AddToDefs.
> Right, this patch deals with the case of NumDefs > NumOutOps .
> Also, sorry about the late reply. I’ve been OOO.

> Let me know if there is any other changes for this patch submission.

> Thanks!

> Aaron (En Ye) Shi
> PEY, SW Engineering | Stream OpenCL
> 1 Commerce Valley Dr E, Markham, ON L3T 3X6
> O +(1) 289-695-0685 M +(1) 647-709-3020
> AMD facebook | amd.com

> From: Hal Finkel [mailto:hfinkel at anl.gov]
> Sent: Tuesday, October 27, 2015 7:33 PM
> To: Matt Arsenault <arsenm2 at gmail.com>
> Cc: Shi, Aaron (en ye) <Aaronenye.Shi at amd.com>;
> llvm-commits at lists.llvm.org
> Subject: Re: [PATCH] TableGen CGIOperandList should use
> NumOutOperands instead of NumDefs

> > From: "Matt Arsenault" < arsenm2 at gmail.com >
> 
> > To: "Hal Finkel" < hfinkel at anl.gov >
> 
> > Cc: "Aaron Shi (en ye)" < Aaronenye.Shi at amd.com >,
> > llvm-commits at lists.llvm.org
> 
> > Sent: Tuesday, October 27, 2015 6:18:14 PM
> 
> > Subject: Re: [PATCH] TableGen CGIOperandList should use
> > NumOutOperands instead of NumDefs
> 

> > > On Oct 27, 2015, at 7:08 PM, Hal Finkel via llvm-commits <
> > > llvm-commits at lists.llvm.org > wrote:
> > 
> 

> > > Hi Aaron,
> > 
> 

> > > + bool addToDefs = false;
> > 
> 

> > > This should be named AddToDefs (local variables in LLVM start
> > > with
> > > a
> > > capital letter).
> > 
> 

> > > Can you provide a small TableGen snippet showing the kinds of
> > > definitions this affects?
> > 
> 

> > > Thanks,
> > 
> 
> > > Hal
> > 
> 
> > These can be found in HSAILInstrFormats.td (in
> > http://reviews.llvm.org/D9751 ) in multiclass LD_Types for the
> > multiple result load instructions
> 
> Alright, I see this:

> multiclass LD_Types<string opName, bits<16> BrigVal> {
> def _S8 : LD<opName, BrigVal, (outs GPR32:$dest)>,
> LdStVectorMap<NAME#"_S8", 1>;
> def _U8 : LD<opName, BrigVal, (outs GPR32:$dest)>,
> LdStVectorMap<NAME#"_U8", 1>;
> ...
> def _V2_S8 : LD<opName#"_v2", BrigVal, (outs Vec2DestOp32:$dest)>,
> LdStVectorMap<NAME#"_S8", 2>;
> def _V2_U8 : LD<opName#"_v2", BrigVal, (outs Vec2DestOp32:$dest)>,
> LdStVectorMap<NAME#"_U8", 2>;
> ...

> and these have one element in their 'outs' list. However, these
> vector operands are actually complex operands:

> def Vec2DestOp32 : Operand<untyped> {
> let MIOperandInfo = (ops HSAILDest32Operand, HSAILDest32Operand);
> let PrintMethod = "printVec2Op";
> }
> So this patch deals with the case where NumDefs > NumOutOps. That
> makes sense.

> -Hal

> --

> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
-- 

Hal Finkel 
Assistant Computational Scientist 
Leadership Computing Facility 
Argonne National Laboratory 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160125/ffc433c0/attachment.html>


More information about the llvm-commits mailing list