diff --git a/src/coreclr/jit/fginline.cpp b/src/coreclr/jit/fginline.cpp index 46e6a35c626d82..6aa105736adb58 100644 --- a/src/coreclr/jit/fginline.cpp +++ b/src/coreclr/jit/fginline.cpp @@ -194,14 +194,12 @@ class SubstitutePlaceholdersAndDevirtualizeWalker : public GenTreeVisitorAsRetExpr(); inlineCandidate = retExpr->gtSubstExpr; - prevInlineeBB = inlineeBB; inlineeBB = retExpr->gtSubstBB; } while (inlineCandidate->OperIs(GT_RET_EXPR)); @@ -242,34 +240,19 @@ class SubstitutePlaceholdersAndDevirtualizeWalker : public GenTreeVisitorbbFlags; - - if (inlineeBB != nullptr) - { - newBBFlags |= inlineeBB->bbFlags & BBF_COPY_PROPAGATE; - } + // IR may potentially contain nodes that requires mandatory BB flags to be set. + // Propagate those flags from the containing BB. + m_compiler->compCurBB->bbFlags |= inlineeBB->bbFlags & BBF_SPLIT_GAINED; } - else if (inlineeBB != nullptr) - { - newBBFlags |= inlineeBB->bbFlags; - } - - m_compiler->compCurBB->bbFlags |= (newBBFlags & BBF_SPLIT_GAINED); #ifdef DEBUG if (m_compiler->verbose)