diff --git a/src/coreclr/jit/block.cpp b/src/coreclr/jit/block.cpp index dbb179e48d1ba..e1f50e2fb1be8 100644 --- a/src/coreclr/jit/block.cpp +++ b/src/coreclr/jit/block.cpp @@ -292,16 +292,12 @@ bool BasicBlock::IsFirstColdBlock(Compiler* compiler) const // compiler - current compiler instance // // Returns: -// true if the peephole optimization is enabled, -// and block is a BBJ_ALWAYS to the next block that we can fall through into +// true if block is a BBJ_ALWAYS to the next block that we can fall into // bool BasicBlock::CanRemoveJumpToNext(Compiler* compiler) { assert(KindIs(BBJ_ALWAYS)); - const bool tryJumpOpt = compiler->opts.OptimizationEnabled() || ((bbFlags & BBF_NONE_QUIRK) != 0); - const bool skipJump = tryJumpOpt && JumpsToNext() && !hasAlign() && ((bbFlags & BBF_KEEP_BBJ_ALWAYS) == 0) && - !compiler->fgInDifferentRegions(this, bbJumpDest); - return skipJump; + return JumpsToNext() && !hasAlign() && !compiler->fgInDifferentRegions(this, bbJumpDest); } //------------------------------------------------------------------------ diff --git a/src/coreclr/jit/codegenlinear.cpp b/src/coreclr/jit/codegenlinear.cpp index 56e62fcbba34e..ab62d35e6e85c 100644 --- a/src/coreclr/jit/codegenlinear.cpp +++ b/src/coreclr/jit/codegenlinear.cpp @@ -731,9 +731,7 @@ void CodeGen::genCodeForBBlist() case BBJ_ALWAYS: { - // Peephole optimization: If this block jumps to the next one, skip emitting the jump - // (unless we are jumping between hot/cold sections, or if we need the jump for EH reasons) - // (Skip this if optimizations are disabled, unless the block shouldn't have a jump in the first place) + // If this block jumps to the next one, we might be able to skip emitting the jump if (block->CanRemoveJumpToNext(compiler)) { #ifdef TARGET_AMD64