[llvm] r223247 - AArch64: fix wrong-endian parameter passing.
Tim Northover
tnorthover at apple.com
Wed Dec 3 09:49:27 PST 2014
Author: tnorthover
Date: Wed Dec 3 11:49:26 2014
New Revision: 223247
URL: http://llvm.org/viewvc/llvm-project?rev=223247&view=rev
Log:
AArch64: fix wrong-endian parameter passing.
The blocked arguments code didn't take account of the hacks needed to support
it.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/trunk/test/CodeGen/AArch64/arm64-aapcs-be.ll
Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=223247&r1=223246&r2=223247&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp Wed Dec 3 11:49:26 2014
@@ -2107,7 +2107,8 @@ SDValue AArch64TargetLowering::LowerForm
unsigned ArgSize = VA.getValVT().getSizeInBits() / 8;
uint32_t BEAlign = 0;
- if (ArgSize < 8 && !Subtarget->isLittleEndian())
+ if (!Subtarget->isLittleEndian() && ArgSize < 8 &&
+ !Ins[i].Flags.isInConsecutiveRegs())
BEAlign = 8 - ArgSize;
int FI = MFI->CreateFixedObject(ArgSize, ArgOffset + BEAlign, true);
@@ -2661,7 +2662,8 @@ AArch64TargetLowering::LowerCall(CallLow
unsigned OpSize = Flags.isByVal() ? Flags.getByValSize() * 8
: VA.getValVT().getSizeInBits();
OpSize = (OpSize + 7) / 8;
- if (!Subtarget->isLittleEndian() && !Flags.isByVal()) {
+ if (!Subtarget->isLittleEndian() && !Flags.isByVal() &&
+ !Flags.isInConsecutiveRegs()) {
if (OpSize < 8)
BEAlign = 8 - OpSize;
}
Modified: llvm/trunk/test/CodeGen/AArch64/arm64-aapcs-be.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/arm64-aapcs-be.ll?rev=223247&r1=223246&r2=223247&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/arm64-aapcs-be.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/arm64-aapcs-be.ll Wed Dec 3 11:49:26 2014
@@ -21,4 +21,20 @@ entry:
; CHECK-DAG: strh w{{[0-9]}}, [sp, #14]
; CHECK-DAG: strb w{{[0-9]}}, [sp, #7]
ret i32 %call
-}
\ No newline at end of file
+}
+
+define float @test_block_addr([8 x float], [1 x float] %in) {
+; CHECK-LABEL: test_block_addr:
+; CHECK: ldr s0, [sp]
+ %val = extractvalue [1 x float] %in, 0
+ ret float %val
+}
+
+define void @test_block_addr_callee() {
+; CHECK-LABEL: test_block_addr_callee:
+; CHECK: str {{[a-z0-9]+}}, [sp]
+; CHECK: bl test_block_addr
+ %val = insertvalue [1 x float] undef, float 0.0, 0
+ call float @test_block_addr([8 x float] undef, [1 x float] %val)
+ ret void
+}
More information about the llvm-commits
mailing list