From 18104e53c5b6f16bca3c29ec6b820425e82a3a75 Mon Sep 17 00:00:00 2001 From: "Aman Khalid (from Dev Box)" Date: Tue, 12 Mar 2024 14:25:01 -0400 Subject: [PATCH] Remove bbFallsThrough restriction in fgOptimizeEmptyBlock --- src/coreclr/jit/fgbasic.cpp | 6 ------ src/coreclr/jit/fgopt.cpp | 9 --------- 2 files changed, 15 deletions(-) diff --git a/src/coreclr/jit/fgbasic.cpp b/src/coreclr/jit/fgbasic.cpp index 9d9c44776b436..775068745e361 100644 --- a/src/coreclr/jit/fgbasic.cpp +++ b/src/coreclr/jit/fgbasic.cpp @@ -5924,12 +5924,6 @@ BasicBlock* Compiler::fgRelocateEHRange(unsigned regionIndex, FG_RELOCATE_TYPE r insertAfterBlk->Next()); // We insert at the end, not at the beginning, of the funclet region. } - // These asserts assume we aren't moving try regions (which we might need to do). Only - // try regions can have fall through into or out of the region. - - noway_assert(!bPrev->bbFallsThrough()); // There can be no fall through into a filter or handler region - noway_assert(!bLast->bbFallsThrough()); // There can be no fall through out of a handler region - #ifdef DEBUG if (verbose) { diff --git a/src/coreclr/jit/fgopt.cpp b/src/coreclr/jit/fgopt.cpp index 13f8970fd247b..6b22f869bf0cb 100644 --- a/src/coreclr/jit/fgopt.cpp +++ b/src/coreclr/jit/fgopt.cpp @@ -1621,15 +1621,6 @@ bool Compiler::fgOptimizeEmptyBlock(BasicBlock* block) break; } } - else - { - // TODO-NoFallThrough: Once BBJ_COND blocks have pointers to their false branches, - // allow removing empty BBJ_ALWAYS and pointing bPrev's false branch to block's target. - if (bPrev->bbFallsThrough() && !block->JumpsToNext()) - { - break; - } - } /* Do not remove a block that jumps to itself - used for while (true){} */ if (block->TargetIs(block))