Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow instrumentation for methods with explicit tail calls #58632

Merged
merged 7 commits into from
Sep 6, 2021
Merged
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
9 changes: 6 additions & 3 deletions src/coreclr/jit/fgbasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2722,9 +2722,12 @@ unsigned Compiler::fgMakeBasicBlocks(const BYTE* codeAddr, IL_OFFSET codeSize, F
if (fgCanSwitchToOptimized() && fgMayExplicitTailCall())
{
// Method has an explicit tail call that may run like a loop or may not be generated as a tail
// call in tier 0, switch to optimized to avoid spending too much time running slower code and
// to avoid stack overflow from recursion
fgSwitchToOptimized();
// call in tier 0, switch to optimized to avoid spending too much time running slower code
if (!opts.jitFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR) ||
((info.compFlags & CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS) != 0))
{
fgSwitchToOptimized();
}
}
}
else
Expand Down