diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index 4b10f4e77a19d1..0339f0381e449d 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -4849,8 +4849,7 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl optLoopCount = 0; // Old dominators and reachability sets are no longer valid. - fgDomsComputed = false; - fgCompactRenumberQuirk = true; + fgDomsComputed = false; } #ifdef DEBUG @@ -5039,7 +5038,6 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl } optLoopsRequirePreHeaders = false; - fgCompactRenumberQuirk = false; #ifdef DEBUG DoPhase(this, PHASE_STRESS_SPLIT_TREE, &Compiler::StressSplitTree); diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 99755980cd910b..eb9a289bc62868 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -5124,7 +5124,6 @@ class Compiler bool fgReturnBlocksComputed; // Have we computed the return blocks list? bool fgOptimizedFinally; // Did we optimize any try-finallys? bool fgCanonicalizedFirstBB; // TODO-Quirk: did we end up canonicalizing first BB? - bool fgCompactRenumberQuirk; // TODO-Quirk: Should fgCompactBlocks renumber BBs above fgDomBBcount? bool fgHasSwitch; // any BBJ_SWITCH jumps? diff --git a/src/coreclr/jit/fgbasic.cpp b/src/coreclr/jit/fgbasic.cpp index 32a2cf3f0412dc..d3c22975b3c4f8 100644 --- a/src/coreclr/jit/fgbasic.cpp +++ b/src/coreclr/jit/fgbasic.cpp @@ -33,7 +33,6 @@ void Compiler::fgInit() /* We haven't yet computed the dominator sets */ fgDomsComputed = false; fgReturnBlocksComputed = false; - fgCompactRenumberQuirk = false; #ifdef DEBUG fgReachabilitySetsValid = false; diff --git a/src/coreclr/jit/fgopt.cpp b/src/coreclr/jit/fgopt.cpp index 824a88feb0427b..973ae6cdba569d 100644 --- a/src/coreclr/jit/fgopt.cpp +++ b/src/coreclr/jit/fgopt.cpp @@ -2356,54 +2356,7 @@ void Compiler::fgCompactBlocks(BasicBlock* block, BasicBlock* bNext) block->RemoveFlags(BBF_NONE_QUIRK); } - // If we're collapsing a block created after the dominators are - // computed, copy block number the block and reuse dominator - // information from bNext to block. - // - // Note we have to do this renumbering after the full set of pred list - // updates above, since those updates rely on stable bbNums; if we renumber - // before the updates, we can create pred lists with duplicate m_block->bbNum - // values (though different m_blocks). - // - if ((fgDomsComputed || fgCompactRenumberQuirk) && (block->bbNum > fgDomBBcount)) - { - if (fgDomsComputed) - { - assert(fgReachabilitySetsValid); - BlockSetOps::Assign(this, block->bbReach, bNext->bbReach); - BlockSetOps::ClearD(this, bNext->bbReach); - - block->bbIDom = bNext->bbIDom; - bNext->bbIDom = nullptr; - - // In this case, there's no need to update the preorder and postorder numbering - // since we're changing the bbNum, this makes the basic block all set. - // - JITDUMP("Renumbering " FMT_BB " to be " FMT_BB " to preserve dominator information\n", block->bbNum, - bNext->bbNum); - } - else - { - // TODO-Quirk: Remove - JITDUMP("Renumbering " FMT_BB " to be " FMT_BB " for a quirk\n", block->bbNum, bNext->bbNum); - } - - block->bbNum = bNext->bbNum; - - // Because we may have reordered pred lists when we swapped in - // block for bNext above, we now need to re-reorder pred lists - // to reflect the bbNum update. - // - // This process of reordering and re-reordering could likely be avoided - // via a different update strategy. But because it's probably rare, - // and we avoid most of the work if pred lists are already in order, - // we'll just ensure everything is properly ordered. - // - for (BasicBlock* const checkBlock : Blocks()) - { - checkBlock->ensurePredListOrder(this); - } - } + assert(!fgDomsComputed); if (optLoopTableValid) { diff --git a/src/coreclr/jit/optimizer.cpp b/src/coreclr/jit/optimizer.cpp index 394b822e98da9f..b05a1a914b40ab 100644 --- a/src/coreclr/jit/optimizer.cpp +++ b/src/coreclr/jit/optimizer.cpp @@ -4590,8 +4590,7 @@ PhaseStatus Compiler::optUnrollLoops() optLoopCount = 0; // Old dominators and reachability sets are no longer valid. - fgDomsComputed = false; - fgCompactRenumberQuirk = true; + fgDomsComputed = false; return anyIRchange ? PhaseStatus::MODIFIED_EVERYTHING : PhaseStatus::MODIFIED_NOTHING; }