[PATCH] TableGen CGIOperandList should use NumOutOperands instead of NumDefs

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 27 16:33:05 PDT 2015


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

> 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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151027/eff8738c/attachment.html>


More information about the llvm-commits mailing list