summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMCallingConv.h
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-11-27 21:02:42 +0000
committerTim Northover <tnorthover@apple.com>2014-11-27 21:02:42 +0000
commit3c55ccac4846ff2a0fbddec7e3440bd88e6e2d16 (patch)
treeffb9faa07a74d6827011e872d77cffb2a46d54e7 /llvm/lib/Target/ARM/ARMCallingConv.h
parent2f206d6ee4404c6511826cd47cfebbfea293ba59 (diff)
downloadbcm5719-llvm-3c55ccac4846ff2a0fbddec7e3440bd88e6e2d16.tar.gz
bcm5719-llvm-3c55ccac4846ff2a0fbddec7e3440bd88e6e2d16.zip
AArch64: treat [N x Ty] as a block during procedure calls.
The AAPCS treats small structs and homogeneous floating (or vector) aggregates specially, and guarantees they either get passed as a contiguous block of registers, or prevent any future use of those registers and get passed on the stack. This concept can fit quite neatly into LLVM's own type system, mapping an HFA to [N x float] and so on, and small structs to [N x i64]. Doing so allows front-ends to emit AAPCS compliant code without having to duplicate the register counting logic. llvm-svn: 222903
Diffstat (limited to 'llvm/lib/Target/ARM/ARMCallingConv.h')
-rw-r--r--llvm/lib/Target/ARM/ARMCallingConv.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Target/ARM/ARMCallingConv.h b/llvm/lib/Target/ARM/ARMCallingConv.h
index bd07236d0ea..4567a2a1afd 100644
--- a/llvm/lib/Target/ARM/ARMCallingConv.h
+++ b/llvm/lib/Target/ARM/ARMCallingConv.h
@@ -194,20 +194,16 @@ static bool CC_ARM_AAPCS_Custom_HA(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
// Try to allocate a contiguous block of registers, each of the correct
// size to hold one member.
- const uint16_t *RegList;
- unsigned NumRegs;
+ ArrayRef<const uint16_t> RegList;
switch (LocVT.SimpleTy) {
case MVT::f32:
RegList = SRegList;
- NumRegs = 16;
break;
case MVT::f64:
RegList = DRegList;
- NumRegs = 8;
break;
case MVT::v2f64:
RegList = QRegList;
- NumRegs = 4;
break;
default:
llvm_unreachable("Unexpected member type for HA");
@@ -215,7 +211,7 @@ static bool CC_ARM_AAPCS_Custom_HA(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
}
unsigned RegResult =
- State.AllocateRegBlock(RegList, NumRegs, PendingHAMembers.size());
+ State.AllocateRegBlock(RegList, PendingHAMembers.size());
if (RegResult) {
for (SmallVectorImpl<CCValAssign>::iterator It = PendingHAMembers.begin();
OpenPOWER on IntegriCloud