llvm.org GIT mirror llvm / 04746ea
Fix pr4058 and pr4059. Do not split i64 or double arguments between r3 and the stack. Patch by Sandeep Patel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72106 91177308-0d34-0410-b5e6-96231b3b80d8 Bob Wilson 11 years ago
3 changed file(s) with 22 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
5050
5151 // i64/f64 is passed in even pairs of GPRs
5252 // i64 is 8-aligned i32 here, so we may need to eat R1 as a pad register
53 // (and the same is true for f64 if VFP is not enabled)
5354 CCIfType<[i32], CCIfAlign<"8", CCAssignToRegWithShadow<[R0, R2], [R0, R1]>>>,
5455 CCIfType<[f64], CCCustom<"CC_ARM_AAPCS_Custom_f64">>,
5556
5657 CCIfType<[f32], CCBitConvertToType>,
57 CCIfType<[i32], CCAssignToReg<[R0, R1, R2, R3]>>,
58 CCIfType<[i32], CCIf<"State.getNextStackOffset() == 0 &&"
59 "ArgFlags.getOrigAlign() != 8",
60 CCAssignToReg<[R0, R1, R2, R3]>>>,
5861
5962 CCIfType<[i32], CCAssignToStack<4, 4>>,
6063 CCIfType<[f64], CCAssignToStack<8, 8>>
0 ; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | not grep r3
1 ; PR4059
2
3 define i32 @f(i64 %z, i32 %a, double %b) {
4 %tmp = call i32 @g(double %b)
5 ret i32 %tmp
6 }
7
8 declare i32 @g(double)
0 ; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | not grep r3
1 ; PR4058
2
3 define i32 @f(i64 %z, i32 %a, i64 %b) {
4 %tmp = call i32 @g(i64 %b)
5 ret i32 %tmp
6 }
7
8 declare i32 @g(i64)