[llvm-branch-commits] [cfe-branch] r73442 - in /cfe/branches/Apple/Dib: lib/CodeGen/CGCall.cpp test/CodeGen/x86_64-arguments.c
Daniel Dunbar
daniel at zuster.org
Mon Jun 15 16:33:39 PDT 2009
Author: ddunbar
Date: Mon Jun 15 18:33:38 2009
New Revision: 73442
URL: http://llvm.org/viewvc/llvm-project?rev=73442&view=rev
Log:
Merge in r72268 (<rdar://problem/6928919>):
------------------------------------------------------------------------
r72268 | ddunbar | 2009-05-22 10:33:44 -0700 (Fri, 22 May 2009) | 3 lines
x86_64 ABI: Account for sret parameters consuming an integer register.
- PR4242.
------------------------------------------------------------------------
Modified:
cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp
cfe/branches/Apple/Dib/test/CodeGen/x86_64-arguments.c
Modified: cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp?rev=73442&r1=73441&r2=73442&view=diff
==============================================================================
--- cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp (original)
+++ cfe/branches/Apple/Dib/lib/CodeGen/CGCall.cpp Mon Jun 15 18:33:38 2009
@@ -1075,6 +1075,11 @@
// Keep track of the number of assigned registers.
unsigned freeIntRegs = 6, freeSSERegs = 8;
+
+ // If the return value is indirect, then the hidden argument is consuming one
+ // integer register.
+ if (FI.getReturnInfo().isIndirect())
+ --freeIntRegs;
// AMD64-ABI 3.2.3p3: Once arguments are classified, the registers
// get assigned (in left-to-right order) for passing as follows...
Modified: cfe/branches/Apple/Dib/test/CodeGen/x86_64-arguments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/test/CodeGen/x86_64-arguments.c?rev=73442&r1=73441&r2=73442&view=diff
==============================================================================
--- cfe/branches/Apple/Dib/test/CodeGen/x86_64-arguments.c (original)
+++ cfe/branches/Apple/Dib/test/CodeGen/x86_64-arguments.c Mon Jun 15 18:33:38 2009
@@ -61,6 +61,14 @@
struct s12 f12_0(void) {}
void f12_1(struct s12 a0) {}
+// Check that sret parameter is accounted for when checking available integer
+// registers.
+// RUN: grep 'define void @f13(.struct.s13_0. noalias sret .agg.result, i32 .a, i32 .b, i32 .c, i32 .d, .struct.s13_1. byval .e, i32 .f)' %t &&
+
+struct s13_0 { long long f0[3]; };
+struct s13_0 f13(int a, int b, int c, int d,
+ struct s13_1 { long long f0[2]; } e, int f) {}
+
// RUN: grep 'define void @f14(.*, i8 signext .X)' %t &&
void f14(int a, int b, int c, int d, int e, int f,
char X) {}
More information about the llvm-branch-commits
mailing list