[llvm-commits] [PATCH] Add the byval attribute and a bit more

Chris Lattner clattner at apple.com
Mon Jul 16 22:59:18 PDT 2007


On Jul 6, 2007, at 4:00 AM, Rafael Espindola wrote:
>> The patch looks good.  Some questions/comments:
>>

Sorry, just now catching up on this thread. :(

>> +++ include/llvm/CodeGen/SelectionDAGNodes.h    (working copy)
>>
>> +    SturtByVal        = 1<<4,  ///< Struct passed by value
>>
>> This looks like a typo "sturt"
> Changed to "ByVal" based on Duncan's comment.

Ok, sounds good.

>> +++ utils/TableGen/CallingConvEmitter.cpp       (working copy)
>> @@ -67,12 +67,14 @@
>>       O << IndentStr << "if (";
>>
>>       if (Action->isSubClassOf("CCIfType")) {
>> +      O << "!(ArgFlags & ISD::ParamFlags::StructByVal) && (";
>>
>>
>> I don't think CCIfType should automatically mask out byval
>> arguments.  Instead, Plz add a new "notbyval" predicate or something
>> so that this logic is explicit in the .td files.
>
> The reason I did this is that if CCIfType matches "byval" arguments,
> the current backends will generate invalid code (handle it like a
> normal pointer). I have just removed the checks for now, since nothing
> is generating "byval"s.
>
> If a add a notbyval predicated, should I add it to all the current
> uses of CCIfType?

I'd suggest that we just let the backends upgrade as they add support  
for byval.  By default, they will codegen as if the thing is passed  
like a pointer.  Target authors should add support for byval if they  
care, before llvm-gcc support goes in.

-Chris





More information about the llvm-commits mailing list