Skip to content

Commit e04d9aa

Browse files
authored
JIT: Generalize hasFixedRetBuffReg for ARM64 (#100277)
Move a check from `CallArgs::GetCustomRegister` to `hasFixedRetBuffReg`.
1 parent b42c516 commit e04d9aa

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/coreclr/jit/gentree.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -1806,11 +1806,7 @@ regNumber CallArgs::GetCustomRegister(Compiler* comp, CorInfoCallConvExtension c
18061806
case WellKnownArg::RetBuffer:
18071807
if (hasFixedRetBuffReg(cc))
18081808
{
1809-
// Windows does not use fixed ret buff arg for instance calls, but does otherwise.
1810-
if (!TargetOS::IsWindows || !callConvIsInstanceMethodCallConv(cc))
1811-
{
1812-
return theFixedRetBuffReg(cc);
1813-
}
1809+
return theFixedRetBuffReg(cc);
18141810
}
18151811

18161812
break;

src/coreclr/jit/target.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ inline bool genIsValidDoubleReg(regNumber reg)
422422
inline bool hasFixedRetBuffReg(CorInfoCallConvExtension callConv)
423423
{
424424
#if defined(TARGET_ARM64)
425-
return true;
425+
// Windows does not use fixed ret buff arg for instance calls, but does otherwise.
426+
return !TargetOS::IsWindows || !callConvIsInstanceMethodCallConv(callConv);
426427
#elif defined(TARGET_AMD64) && defined(SWIFT_SUPPORT)
427428
return callConv == CorInfoCallConvExtension::Swift;
428429
#else

0 commit comments

Comments
 (0)