diff --git a/src/coreclr/jit/block.cpp b/src/coreclr/jit/block.cpp index 95f7537f145695..03c1c23ddeeb0a 100644 --- a/src/coreclr/jit/block.cpp +++ b/src/coreclr/jit/block.cpp @@ -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"}, diff --git a/src/coreclr/jit/block.h b/src/coreclr/jit/block.h index 15595d5462bc56..33919a3e51e656 100644 --- a/src/coreclr/jit/block.h +++ b/src/coreclr/jit/block.h @@ -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 diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index b1542a133ec3fd..6a7b5a219b8fbe 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -5592,7 +5592,7 @@ void Compiler::SplitTreesRemoveCommas() // void Compiler::generatePatchpointInfo() { - if (!doesMethodHavePatchpoints() && !doesMethodHavePartialCompilationPatchpoints()) + if (!doesMethodHavePatchpoints()) { // Nothing to report return; diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 2ba16e70020f29..f40d4488d3aa3c 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -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. @@ -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() diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index 0ff1ab40625d97..52efc436d8312e 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -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) { @@ -2656,7 +2656,7 @@ inline bool Compiler::lvaReportParamTypeArg() // Methoods that have patchpoints always report context as live // - if (doesMethodHavePatchpoints() || doesMethodHavePartialCompilationPatchpoints()) + if (doesMethodHavePatchpoints()) { return true; } diff --git a/src/coreclr/jit/fgbasic.cpp b/src/coreclr/jit/fgbasic.cpp index 2017fec359ea76..58d698443b3dd8 100644 --- a/src/coreclr/jit/fgbasic.cpp +++ b/src/coreclr/jit/fgbasic.cpp @@ -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 diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 9898b5e25b088b..84749718f92d18 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -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. @@ -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); } } } @@ -6187,7 +6187,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) else { assert(!block->hasHndIndex()); - block->SetFlags(BBF_PATCHPOINT); + block->SetFlags(BBF_OSR_PATCHPOINT); } setMethodHasPatchpoint(); @@ -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. // @@ -6244,7 +6244,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) if (addPatchpoint) { - block->SetFlags(BBF_PATCHPOINT); + block->SetFlags(BBF_OSR_PATCHPOINT); setMethodHasPatchpoint(); } @@ -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? // @@ -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. // diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index c53e8a69078cc4..d0ed9cac39716c 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -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; @@ -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; diff --git a/src/coreclr/jit/lsra.cpp b/src/coreclr/jit/lsra.cpp index d70f8c3ecbff52..f4ea5bf6ec76b9 100644 --- a/src/coreclr/jit/lsra.cpp +++ b/src/coreclr/jit/lsra.cpp @@ -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; diff --git a/src/coreclr/jit/patchpoint.cpp b/src/coreclr/jit/patchpoint.cpp index 3649ee4e72d638..25ffea62cb493f 100644 --- a/src/coreclr/jit/patchpoint.cpp +++ b/src/coreclr/jit/patchpoint.cpp @@ -50,7 +50,7 @@ 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. // @@ -58,7 +58,7 @@ class PatchpointTransformer // 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); @@ -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;