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
2 changes: 1 addition & 1 deletion src/coreclr/jit/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ void BasicBlock::dspFlags() const
{BBF_BACKWARD_JUMP, "bwd"},
{BBF_BACKWARD_JUMP_TARGET, "bwd-target"},
{BBF_BACKWARD_JUMP_SOURCE, "bwd-src"},
{BBF_PATCHPOINT, "ppoint"},
{BBF_OSR_PATCHPOINT, "osr-ppoint"},
{BBF_PARTIAL_COMPILATION_PATCHPOINT, "pc-ppoint"},
{BBF_HAS_HISTOGRAM_PROFILE, "hist"},
{BBF_TAILCALL_SUCCESSOR, "tail-succ"},
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ enum BasicBlockFlags : uint64_t
BBF_BACKWARD_JUMP = MAKE_BBFLAG(23), // BB is surrounded by a backward jump/switch arc
BBF_BACKWARD_JUMP_SOURCE = MAKE_BBFLAG(24), // Block is a source of a backward jump
BBF_BACKWARD_JUMP_TARGET = MAKE_BBFLAG(25), // Block is a target of a backward jump
BBF_PATCHPOINT = MAKE_BBFLAG(26), // Block is a patchpoint
BBF_OSR_PATCHPOINT = MAKE_BBFLAG(26), // Block is a patchpoint
BBF_PARTIAL_COMPILATION_PATCHPOINT = MAKE_BBFLAG(27), // Block is a partial compilation patchpoint
BBF_HAS_HISTOGRAM_PROFILE = MAKE_BBFLAG(28), // BB contains a call needing a histogram profile
BBF_TAILCALL_SUCCESSOR = MAKE_BBFLAG(29), // BB has pred that has potential tail call
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5592,7 +5592,7 @@ void Compiler::SplitTreesRemoveCommas()
//
void Compiler::generatePatchpointInfo()
{
if (!doesMethodHavePatchpoints() && !doesMethodHavePartialCompilationPatchpoints())
if (!doesMethodHavePatchpoints())
{
// Nothing to report
return;
Expand Down
11 changes: 0 additions & 11 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7609,7 +7609,6 @@ class Compiler
#define OMF_HAS_EXPRUNTIMELOOKUP 0x00000080 // Method contains a runtime lookup to an expandable dictionary.
#define OMF_HAS_PATCHPOINT 0x00000100 // Method contains patchpoints
#define OMF_NEEDS_GCPOLLS 0x00000200 // Method needs GC polls
#define OMF_HAS_PARTIAL_COMPILATION_PATCHPOINT 0x00000800 // Method contains partial compilation patchpoints
#define OMF_HAS_TAILCALL_SUCCESSOR 0x00001000 // Method has potential tail call in a non BBJ_RETURN block
#define OMF_HAS_MDNEWARRAY 0x00002000 // Method contains 'new' of an MD array
#define OMF_HAS_MDARRAYREF 0x00004000 // Method contains multi-dimensional intrinsic array element loads or stores.
Expand Down Expand Up @@ -7793,16 +7792,6 @@ class Compiler
optMethodFlags |= OMF_HAS_PATCHPOINT;
}

bool doesMethodHavePartialCompilationPatchpoints()
{
return (optMethodFlags & OMF_HAS_PARTIAL_COMPILATION_PATCHPOINT) != 0;
}

void setMethodHasPartialCompilationPatchpoint()
{
optMethodFlags |= OMF_HAS_PARTIAL_COMPILATION_PATCHPOINT;
}

unsigned optMethodFlags = 0;

bool doesMethodHaveNoReturnCalls()
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2616,7 +2616,7 @@ inline bool Compiler::lvaKeepAliveAndReportThis()
if (genericsContextIsThis)
{
const bool mustKeep = (info.compMethodInfo->options & CORINFO_GENERICS_CTXT_KEEP_ALIVE) != 0;
const bool hasPatchpoint = doesMethodHavePatchpoints() || doesMethodHavePartialCompilationPatchpoints();
const bool hasPatchpoint = doesMethodHavePatchpoints();

if (lvaGenericsContextInUse || mustKeep || hasPatchpoint)
{
Expand Down Expand Up @@ -2656,7 +2656,7 @@ inline bool Compiler::lvaReportParamTypeArg()

// Methoods that have patchpoints always report context as live
//
if (doesMethodHavePatchpoints() || doesMethodHavePartialCompilationPatchpoints())
if (doesMethodHavePatchpoints())
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/fgbasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4692,7 +4692,7 @@ BasicBlock* Compiler::fgSplitBlockAtEnd(BasicBlock* curr)
newBlock->CopyFlags(curr);

// Remove flags that the new block can't have.
newBlock->RemoveFlags(BBF_KEEP_BBJ_ALWAYS | BBF_PATCHPOINT | BBF_BACKWARD_JUMP_TARGET | BBF_LOOP_ALIGN);
newBlock->RemoveFlags(BBF_KEEP_BBJ_ALWAYS | BBF_OSR_PATCHPOINT | BBF_BACKWARD_JUMP_TARGET | BBF_LOOP_ALIGN);

// Remove the GC safe bit on the new block. It seems clear that if we split 'curr' at the end,
// such that all the code is left in 'curr', and 'newBlock' just gets the control flow, then
Expand Down
14 changes: 7 additions & 7 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6160,7 +6160,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)

// We may already have decided to put a patchpoint in succBlock. If not, add one.
//
if (succBlock->HasFlag(BBF_PATCHPOINT))
if (succBlock->HasFlag(BBF_OSR_PATCHPOINT))
{
// In some cases the target may not be stack-empty at entry.
// If so, we will bypass patchpoints for this backedge.
Expand All @@ -6178,7 +6178,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
block->bbNum, succBlock->bbNum);

assert(!succBlock->hasHndIndex());
succBlock->SetFlags(BBF_PATCHPOINT);
succBlock->SetFlags(BBF_OSR_PATCHPOINT);
}
}
}
Expand All @@ -6187,7 +6187,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
else
{
assert(!block->hasHndIndex());
block->SetFlags(BBF_PATCHPOINT);
block->SetFlags(BBF_OSR_PATCHPOINT);
}

setMethodHasPatchpoint();
Expand All @@ -6214,7 +6214,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
const bool tryRandomOSR = randomOSR > 0;

if (compCanHavePatchpoints() && (tryOffsetOSR || tryRandomOSR) && (stackState.esStackDepth == 0) &&
!block->hasHndIndex() && !block->HasFlag(BBF_PATCHPOINT))
!block->hasHndIndex() && !block->HasFlag(BBF_OSR_PATCHPOINT))
{
// Block start can have a patchpoint. See if we should add one.
//
Expand Down Expand Up @@ -6244,7 +6244,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)

if (addPatchpoint)
{
block->SetFlags(BBF_PATCHPOINT);
block->SetFlags(BBF_OSR_PATCHPOINT);
setMethodHasPatchpoint();
}

Expand All @@ -6271,7 +6271,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
// that we need to do proper liveness analysis.
//
if (enablePartialCompilation && compCanHavePatchpoints() && !compTailPrefixSeen && !compIsAsync() &&
(stackState.esStackDepth == 0) && !block->HasFlag(BBF_PATCHPOINT) && !block->hasHndIndex())
(stackState.esStackDepth == 0) && !block->HasFlag(BBF_OSR_PATCHPOINT) && !block->hasHndIndex())
{
// Is this block a good place for partial compilation?
//
Expand Down Expand Up @@ -6300,7 +6300,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
JITDUMP("\nBlock " FMT_BB " (%s) will be a partial compilation patchpoint -- not importing\n", block->bbNum,
reason);
block->SetFlags(BBF_PARTIAL_COMPILATION_PATCHPOINT);
setMethodHasPartialCompilationPatchpoint();
setMethodHasPatchpoint();

// Block will no longer flow to any of its successors.
//
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/lclvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4828,7 +4828,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals()
//
// Currently this is x64 only.
//
if (doesMethodHavePatchpoints() || doesMethodHavePartialCompilationPatchpoints())
if (doesMethodHavePatchpoints())
{
const unsigned regsPushed = compCalleeRegsPushed + (codeGen->isFramePointerUsed() ? 1 : 0);
const unsigned extraSlots = genCountBits(RBM_OSR_INT_CALLEE_SAVED) - regsPushed;
Expand Down Expand Up @@ -6732,7 +6732,7 @@ Compiler::fgWalkResult Compiler::lvaStressLclFldCB(GenTree** pTree, fgWalkData*
// Likewise for Tier0 methods with patchpoints --
// if we modify them we'll misreport their locations in the patchpoint info.
//
if (pComp->doesMethodHavePatchpoints() || pComp->doesMethodHavePartialCompilationPatchpoints())
if (pComp->doesMethodHavePatchpoints())
{
varDsc->lvNoLclFldStress = true;
return WALK_CONTINUE;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ LinearScan::LinearScan(Compiler* theCompiler)
#ifdef TARGET_AMD64
// On x64 the OSR method does not restore float/mask registers from the
// tier0 frame, so disallow using those in the tier0 method.
if (m_compiler->doesMethodHavePatchpoints() || m_compiler->doesMethodHavePartialCompilationPatchpoints())
if (m_compiler->doesMethodHavePatchpoints())
{
#if defined(UNIX_AMD64_ABI)
availableFloatRegs &= ~RBM_FLT_CALLEE_SAVED;
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/jit/patchpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ class PatchpointTransformer
int count = 0;
for (BasicBlock* const block : compiler->Blocks(compiler->fgFirstBB->Next()))
{
if (block->HasFlag(BBF_PATCHPOINT))
if (block->HasFlag(BBF_OSR_PATCHPOINT))
{
// We can't OSR from funclets.
//
assert(!block->hasHndIndex());

// Clear the patchpoint flag.
//
block->RemoveFlags(BBF_PATCHPOINT);
block->RemoveFlags(BBF_OSR_PATCHPOINT);

JITDUMP("Patchpoint: regular patchpoint in " FMT_BB "\n", block->bbNum);
TransformBlock(block);
Expand Down Expand Up @@ -257,7 +257,7 @@ class PatchpointTransformer
//
PhaseStatus Compiler::fgTransformPatchpoints()
{
if (!doesMethodHavePatchpoints() && !doesMethodHavePartialCompilationPatchpoints())
if (!doesMethodHavePatchpoints())
{
JITDUMP("\n -- no patchpoints to transform\n");
return PhaseStatus::MODIFIED_NOTHING;
Expand Down
Loading