Skip to content

Commit 66fe4a6

Browse files
Fix weight diffs
1 parent 83336f9 commit 66fe4a6

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/coreclr/jit/emit.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,8 +1595,6 @@ void emitter::perfScoreUnhandledInstruction(instrDesc* id, insExecutionCharacter
15951595
pResult->insLatency = PERFSCORE_LATENCY_1C;
15961596
}
15971597

1598-
#endif // defined(DEBUG) || defined(LATE_DISASM)
1599-
16001598
//----------------------------------------------------------------------------------------
16011599
// getCurrentBlockWeight: Return the block weight for the currently active block
16021600
//
@@ -1618,12 +1616,19 @@ weight_t emitter::getCurrentBlockWeight()
16181616
{
16191617
return m_compiler->compCurBB->getBBWeight(m_compiler);
16201618
}
1621-
else // we have a null compCurBB
1619+
else if (emitCurIG != nullptr)
1620+
{
1621+
// Prolog or epilog case, use the weight of the head group or its extensions.
1622+
assert((emitCurIG->igFlags & IGF_OUT_OF_ORDER_MASK) != 0);
1623+
return emitCurIG->igWeight;
1624+
}
1625+
else
16221626
{
1623-
// prolog or epilog case, so just use the standard weight
1627+
// This is the prolog case (when we're just initializing the IG list).
16241628
return BB_UNITY_WEIGHT;
16251629
}
16261630
}
1631+
#endif // defined(DEBUG) || defined(LATE_DISASM)
16271632

16281633
#if defined(TARGET_LOONGARCH64)
16291634
void emitter::dispIns(instrDesc* id)

0 commit comments

Comments
 (0)