{
bool bbInALoop = (block->bbFlags & BBF_BACKWARD_JUMP) != 0;
bool bbIsReturn = block->bbJumpKind == BBJ_RETURN;
- // TODO: Zero-inits in LSRA are created with below condition. Try to use similar condition here as well.
- // if (compiler->info.compInitMem || varTypeIsGC(varDsc->TypeGet()))
+ // TODO: Zero-inits in LSRA are created with below condition. But if filter out based on that condition
+ // we filter lot of interesting variables that would benefit otherwise with EH var enregistration.
+ // bool needsExplicitZeroInit = !varDsc->lvIsParam && (info.compInitMem ||
+ // varTypeIsGC(varDsc->TypeGet()));
bool needsExplicitZeroInit = fgVarNeedsExplicitZeroInit(lclNum, bbInALoop, bbIsReturn);
if (varDsc->lvSingleDefRegCandidate || needsExplicitZeroInit)
// it to a different register file.
allocate = false;
}
+ else if ((currentInterval->isWriteThru) && (refType == RefTypeZeroInit))
+ {
+ // For RefTypeZeroInit which is a write thru, there is no need to allocate register
+ // right away. It can be assigned when actually definition occurs.
+ // In future, see if avoiding allocation for RefTypeZeroInit gives any benefit in general.
+ allocate = false;
+ }
if (!allocate)
{
INDEBUG(dumpLsraAllocationEvent(LSRA_EVENT_NO_ENTRY_REG_ALLOCATED, currentInterval));