R600/SI: Support byval arguments
authorVincent Lejeune <vljn@ovi.com>
Sun, 13 Oct 2013 17:56:16 +0000 (17:56 +0000)
committerVincent Lejeune <vljn@ovi.com>
Sun, 13 Oct 2013 17:56:16 +0000 (17:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192555 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/R600/AMDGPUCallingConv.td
lib/Target/R600/SIISelLowering.cpp

index d26be32609475b19a1e30909a76a9907e2c14aab..a194e6d3c8bb59d53485b6f11349053f1dce38e6 100644 (file)
@@ -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 ]
+  >>>
 
 ]>;
 
index 7cd14d5da61376e46072d6af0200caa61d9b2753..098ca7f06c12996cc7597a06ba7bbc5dcff6e1bf 100644 (file)
@@ -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!");