From bed1751533de5148d4143228d4077c3935379a62 Mon Sep 17 00:00:00 2001 From: Aman Khalid Date: Mon, 24 Jun 2024 19:30:08 +0000 Subject: [PATCH] JIT: Fix debug flowgraph check for un-compacted blocks (#103904) --- src/coreclr/jit/compiler.h | 2 +- src/coreclr/jit/fgdiagnostic.cpp | 4 ++-- src/coreclr/jit/fgopt.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 9450c973bf2f4..0c908fd15daa7 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -6223,7 +6223,7 @@ class Compiler static fgWalkPreFn fgStress64RsltMulCB; void fgStress64RsltMul(); - void fgDebugCheckUpdate(); + void fgDebugCheckUpdate(const bool doAggressiveCompaction); void fgDebugCheckBBNumIncreasing(); void fgDebugCheckBBlist(bool checkBBNum = false, bool checkBBRefs = true); diff --git a/src/coreclr/jit/fgdiagnostic.cpp b/src/coreclr/jit/fgdiagnostic.cpp index 48c7d685ed32a..ffc7a933b5cb5 100644 --- a/src/coreclr/jit/fgdiagnostic.cpp +++ b/src/coreclr/jit/fgdiagnostic.cpp @@ -56,7 +56,7 @@ void Compiler::fgPrintEdgeWeights() #ifdef DEBUG -void Compiler::fgDebugCheckUpdate() +void Compiler::fgDebugCheckUpdate(const bool doAggressiveCompaction) { if (!compStressCompile(STRESS_CHK_FLOW_UPDATE, 30)) { @@ -139,7 +139,7 @@ void Compiler::fgDebugCheckUpdate() /* no un-compacted blocks */ - if (fgCanCompactBlock(block)) + if (fgCanCompactBlock(block) && (doAggressiveCompaction || block->JumpsToNext())) { noway_assert(!"Found un-compacted blocks!"); } diff --git a/src/coreclr/jit/fgopt.cpp b/src/coreclr/jit/fgopt.cpp index 975ad0aaa546e..6720dcb8c003a 100644 --- a/src/coreclr/jit/fgopt.cpp +++ b/src/coreclr/jit/fgopt.cpp @@ -5691,7 +5691,7 @@ bool Compiler::fgUpdateFlowGraph(bool doTailDuplication /* = false */, fgVerifyHandlerTab(); // Make sure that the predecessor lists are accurate fgDebugCheckBBlist(); - fgDebugCheckUpdate(); + fgDebugCheckUpdate(doAggressiveCompaction); } #endif // DEBUG