Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 3c2ac22

Browse files
author
Viacheslav Nikolaev
committed
Fix for #5877: pre-spill just the floating arguments
1 parent 9990ac9 commit 3c2ac22

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/jit/lclvars.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,10 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
557557
// For ARM, ARM64, and AMD64 varargs, all arguments go in integer registers
558558
var_types argType = mangleVarArgsType(varDsc->TypeGet());
559559
var_types origArgType = argType;
560+
// ARM softfp calling convention should affect only the floating point arguments.
561+
// Otherwise there appear too many surplus pre-spills and other memory operations
562+
// with the associated locations .
563+
bool isSoftFPPreSpill = opts.compUseSoftFP && varTypeIsFloating(varDsc->TypeGet());
560564
unsigned argSize = eeGetArgSize(argLst, &info.compMethodInfo->args);
561565
unsigned cSlots = argSize / TARGET_POINTER_SIZE; // the total number of slots of this argument
562566
bool isHfaArg = false;
@@ -591,7 +595,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
591595
// But we pre-spill user arguments in varargs methods and structs.
592596
//
593597
unsigned cAlign;
594-
bool preSpill = info.compIsVarArgs || opts.compUseSoftFP;
598+
bool preSpill = info.compIsVarArgs || isSoftFPPreSpill;
595599

596600
switch (origArgType)
597601
{
@@ -921,7 +925,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo * varDscInfo)
921925
#else // !FEATURE_UNIX_AMD64_STRUCT_PASSING
922926
compArgSize += argSize;
923927
#endif // !FEATURE_UNIX_AMD64_STRUCT_PASSING
924-
if (info.compIsVarArgs || isHfaArg || opts.compUseSoftFP)
928+
if (info.compIsVarArgs || isHfaArg || isSoftFPPreSpill)
925929
{
926930
#if defined(_TARGET_X86_)
927931
varDsc->lvStkOffs = compArgSize;

0 commit comments

Comments
 (0)