Skip to content

Commit baabdec

Browse files
committed
[mips] Do not use function CC_MipsN_VarArg unless the function being analyzed
is a vararg function. The original code was examining flag OutputArg::IsFixed to determine whether CC_MipsN_VarArg or CC_MipsN should be called. This is not correct, since this flag is often set to false when the function being analyzed is a non-variadic function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174442 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent dd3aa9e commit baabdec

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/Target/Mips/MipsISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3793,7 +3793,7 @@ MipsTargetLowering::MipsCC::MipsCC(CallingConv::ID CallConv, bool IsVarArg,
37933793
IntArgRegs = Mips64IntRegs;
37943794
ShadowRegs = Mips64DPRegs;
37953795
FixedFn = CC_MipsN;
3796-
VarFn = CC_MipsN_VarArg;
3796+
VarFn = IsVarArg ? CC_MipsN_VarArg : CC_MipsN;
37973797
}
37983798

37993799
if (CallConv == CallingConv::Fast) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
; RUN: llc -march=mips64el -mcpu=mips64r2 -O3 < %s | FileCheck %s
2+
3+
; Check that %add is not passed in an integer register.
4+
;
5+
; CHECK-NOT: dmfc1 $4
6+
7+
define double @callfloor(double %d) nounwind readnone {
8+
entry:
9+
%add = fadd double %d, 1.000000e+00
10+
%call = tail call double @floor(double %add) nounwind readnone
11+
ret double %call
12+
}
13+
14+
declare double @floor(double) nounwind readnone

0 commit comments

Comments
 (0)