From 44e89149264beb6ffd291482e146db02056a1405 Mon Sep 17 00:00:00 2001 From: "Aman Khalid (from Dev Box)" Date: Tue, 11 Feb 2025 16:05:50 -0500 Subject: [PATCH] Don't put cold blocks in RPO --- src/coreclr/jit/fgopt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/jit/fgopt.cpp b/src/coreclr/jit/fgopt.cpp index 7f5cf679ff64f8..cb17a22de69054 100644 --- a/src/coreclr/jit/fgopt.cpp +++ b/src/coreclr/jit/fgopt.cpp @@ -4677,10 +4677,10 @@ void Compiler::fgDoReversePostOrderLayout() BasicBlock** const rpoSequence = new (this, CMK_BasicBlock) BasicBlock*[m_dfsTree->GetPostOrderCount()]; unsigned numBlocks = 0; - auto addToSequence = [rpoSequence, &numBlocks](BasicBlock* block) { - // Exclude handler regions from being reordered. + auto addToSequence = [this, rpoSequence, &numBlocks](BasicBlock* block) { + // Exclude handler regions and cold blocks from being reordered. // - if (!block->hasHndIndex()) + if (!block->hasHndIndex() && !block->isBBWeightCold(this)) { rpoSequence[numBlocks++] = block; }