Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 10 additions & 2 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7025,8 +7025,16 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr,
#ifdef DEBUG
if (JitConfig.JitInstrumentIfOptimizing() && opts.OptimizationEnabled() && !IsReadyToRun())
{
JITDUMP("\nForcibly enabling instrumentation\n");
opts.jitFlags->Set(JitFlags::JIT_FLAG_BBINSTR);
// Optionally disable by range
//
static ConfigMethodRange JitInstrumentIfOptimizingRange;
JitInstrumentIfOptimizingRange.EnsureInit(JitConfig.JitInstrumentIfOptimizingRange());
const unsigned hash = impInlineRoot()->info.compMethodHash();
if (JitInstrumentIfOptimizingRange.Contains(hash))
{
JITDUMP("\nEnabling instrumentation\n");
opts.jitFlags->Set(JitFlags::JIT_FLAG_BBINSTR);
}
}
#endif

Expand Down
1 change: 1 addition & 0 deletions src/coreclr/jit/jitconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ RELEASE_CONFIG_INTEGER(JitCollect64BitCounts, "JitCollect64BitCounts", 0) // Col

CONFIG_INTEGER(JitInstrumentIfOptimizing, "JitInstrumentIfOptimizing", 0) // 1: Always add instrumentation if optimizing
// and not prejitting
CONFIG_STRING(JitInstrumentIfOptimizingRange, "JitInstrumentIfOptimizingRange")

RELEASE_CONFIG_INTEGER(JitInstrumentInlinees, "JitInstrumentInlinees", 1) // Add instrumentation to inlined methods

Expand Down
7 changes: 6 additions & 1 deletion src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3504,8 +3504,10 @@ GenTree* Lowering::LowerTailCallViaJitHelper(GenTreeCall* call, GenTree* callTar
assert(argEntry != nullptr);
GenTree* arg0 = argEntry->GetEarlyNode()->AsPutArgStk()->gtGetOp1();

// Temporarily link in the call target range just before the call, since it
// may refer to a spilled temp. We will move the putarg after this via MoveCFGCallArgs below.
ContainCheckRange(callTargetRange);
BlockRange().InsertAfter(arg0, std::move(callTargetRange));
BlockRange().InsertBefore(call, std::move(callTargetRange));
Comment thread
AndyAyersMS marked this conversation as resolved.
Outdated

bool isClosed;
LIR::ReadOnlyRange secondArgRange = BlockRange().GetTreeRange(arg0, &isClosed);
Expand Down Expand Up @@ -3540,6 +3542,9 @@ GenTree* Lowering::LowerTailCallViaJitHelper(GenTreeCall* call, GenTree* callTar
assert(arg3->OperIs(GT_CNS_INT));
#endif // DEBUG

// Now reorder so all the putargs are just before the call.
MoveCFGCallArgs(call);
Comment thread
AndyAyersMS marked this conversation as resolved.
Outdated

// Transform this call node into a call to Jit tail call helper.
call->gtCallType = CT_HELPER;
call->gtCallMethHnd = comp->eeFindHelper(CORINFO_HELP_TAILCALL);
Expand Down
Loading