Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7091,9 +7091,11 @@ class Compiler
bool fgHasLoops = false;

protected:
unsigned optCallCount = 0; // number of calls made in the method
unsigned optIndirectCallCount = 0; // number of virtual, interface and indirect calls made in the method
unsigned optNativeCallCount = 0; // number of Pinvoke/Native calls made in the method
unsigned optCallCount = 0; // number of calls made in the method
unsigned optIndirectCallCount = 0; // number of virtual, interface and indirect calls made in the method
unsigned optNativeCallCount = 0; // number of Pinvoke/Native calls made in the method
unsigned optFastTailCallCount = 0; // number of fast tail calls made in the method
unsigned optIndirectFastTailCallCount = 0; // number of indirect (see above) fast tail calls made in the method

#ifdef DEBUG
void optCheckPreds();
Expand Down
13 changes: 13 additions & 0 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6374,6 +6374,11 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call)
{
optCallCount++;
optIndirectCallCount++;
if (call->IsFastTailCall())
{
optFastTailCallCount++;
optIndirectFastTailCallCount++;
}
}
else if (call->gtCallType == CT_USER_FUNC)
{
Expand All @@ -6382,6 +6387,14 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call)
{
optIndirectCallCount++;
}
if (call->IsFastTailCall())
{
optFastTailCallCount++;
if (call->IsVirtual())
{
optIndirectFastTailCallCount++;
}
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/regalloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ bool Compiler::rpMustCreateEBPFrame(INDEBUG(const char** wbReason))
INDEBUG(reason = "Method has Loops");
result = true;
}
if (!result && (optCallCount >= 2))
if (!result && (optCallCount >= optFastTailCallCount + 2))
{
INDEBUG(reason = "Call Count");
result = true;
}
if (!result && (optIndirectCallCount >= 1))
if (!result && (optIndirectCallCount >= optIndirectFastTailCallCount + 1))
{
INDEBUG(reason = "Indirect Call");
result = true;
Expand Down
Loading