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

Rafael Espindola espindola at google.com
Fri Jul 6 04:00:42 PDT 2007


> The patch looks good.  Some questions/comments:
>
> +++ 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.

> +++ 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?

> Please add code to the verifier that checks that the "byval"
> attribute is only applied to pointers.  You should find similar code
> that handles "stret".
Done.

> Thanks Rafael!
>
> -Chris

Cheers,
-- 
Rafael Avila de Espindola

Google Ireland Ltd.
Gordon House
Barrow Street
Dublin 4
Ireland

Registered in Dublin, Ireland
Registration Number: 368047



More information about the llvm-commits mailing list