File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -5596,8 +5596,13 @@ void LinearScan::allocateRegisters()
55965596 {
55975597 allocate = false ;
55985598 }
5599- else if (refType == RefTypeParamDef && varDsc->lvRefCntWtd () <= BB_UNITY_WEIGHT)
5599+ else if (refType == RefTypeParamDef && (varDsc->lvRefCntWtd () <= BB_UNITY_WEIGHT) &&
5600+ (!currentRefPosition->lastUse || (currentInterval->physReg == REG_STK)))
56005601 {
5602+ // If this is a low ref-count parameter, and either it is used (def is not the last use) or it's
5603+ // passed on the stack, don't allocate a register.
5604+ // Note that if this is an unused register parameter we don't want to set allocate to false because that
5605+ // will cause us to allocate stack space to spill it.
56015606 allocate = false ;
56025607 }
56035608 else if ((currentInterval->physReg == REG_STK) && nextRefPosition->treeNode ->OperIs (GT_BITCAST))
You can’t perform that action at this time.
0 commit comments