[Mesa-dev] [PATCH] R600/SI: Support byval arguments

Vincent Lejeune vljn at ovi.com
Thu Oct 10 16:52:26 CEST 2013


llvm does not allow function attribute to flagged byval and inreg at the same time.

It works currently because we don't verify our module in mesa, as our "byval inreg" arguments
are considered byval by the sinking pass, and inreg by ISel pass.


The patch : http://lists.freedesktop.org/archives/mesa-dev/2013-October/046022.html fixes the situation
but requires the backend to provide a way to lower byval arguments.
This patch provides such support.

Vincent
>________________________________
> De : Tom Stellard <tom at stellard.net>
>À : Vincent Lejeune <vljn at ovi.com> 
>Cc : mesa-dev at lists.freedesktop.org 
>Envoyé le : Jeudi 10 octobre 2013 15h19
>Objet : Re: [Mesa-dev] [PATCH] R600/SI: Support byval arguments
> 
>
>On Thu, Oct 10, 2013 at 12:04:16AM +0200, Vincent Lejeune wrote:
>
>What is the purpose of this change?
>
>-Tom
>
>
>> ---
>>  lib/Target/R600/AMDGPUCallingConv.td | 7 ++++++-
>>  lib/Target/R600/SIISelLowering.cpp   | 3 ++-
>>  2 files changed, 8 insertions(+), 2 deletions(-)
>> 
>> diff --git a/lib/Target/R600/AMDGPUCallingConv.td b/lib/Target/R600/AMDGPUCallingConv.td
>> index d26be32..a194e6d 100644
>> --- a/lib/Target/R600/AMDGPUCallingConv.td
>> +++ b/lib/Target/R600/AMDGPUCallingConv.td
>> @@ -33,7 +33,12 @@ def CC_SI : CallingConv<[
>>      VGPR8, VGPR9, VGPR10, VGPR11, VGPR12, VGPR13, VGPR14, VGPR15,
>>      VGPR16, VGPR17, VGPR18, VGPR19, VGPR20, VGPR21, VGPR22, VGPR23,
>>      VGPR24, VGPR25, VGPR26, VGPR27, VGPR28, VGPR29, VGPR30, VGPR31
>> -  ]>>>
>> +  ]>>>,
>> +
>> +  CCIfByVal<CCIfType<[i64] , CCAssignToRegWithShadow<
>> +    [ SGPR0, SGPR2, SGPR4, SGPR6, SGPR8, SGPR10, SGPR12, SGPR14 ],
>> +    [ SGPR1, SGPR3, SGPR5, SGPR7, SGPR9, SGPR11, SGPR13, SGPR15 ]
>> +  >>>
>>  
>>  ]>;
>>  
>> diff --git a/lib/Target/R600/SIISelLowering.cpp b/lib/Target/R600/SIISelLowering.cpp
>> index 2174753..cd18154 100644
>> --- a/lib/Target/R600/SIISelLowering.cpp
>> +++ b/lib/Target/R600/SIISelLowering.cpp
>> @@ -158,7 +158,8 @@ SDValue SITargetLowering::LowerFormalArguments(
>>      const ISD::InputArg &Arg = Ins[i];
>>  
>>      // First check if it's a PS input addr
>> -    if (Info->ShaderType == ShaderType::PIXEL && !Arg.Flags.isInReg()) {
>> +    if (Info->ShaderType == ShaderType::PIXEL && !Arg.Flags.isInReg() &&
>> +        !Arg.Flags.isByVal()) {
>>  
>>        assert((PSInputNum <= 15) && "Too many PS inputs!");
>>  
>> -- 
>> 1.8.3.1
>> 
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
>
>


More information about the mesa-dev mailing list