Skip to content

Commit

Permalink
Fix weight computation in jit (#47470)
Browse files Browse the repository at this point in the history
This appears to be a typo. weight1 is from dsc1 and weight2 is from
dsc2. If we checking whether dsc1 is a register arg, we should be
adjusting weight1, not weight2.
  • Loading branch information
omajid authored Feb 3, 2021
1 parent 8399bae commit 4de28f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/jit/lclvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3348,7 +3348,7 @@ class LclVarDsc_SmallCode_Less
{
if (dsc1->lvIsRegArg)
{
weight2 += 2 * BB_UNITY_WEIGHT_UNSIGNED;
weight1 += 2 * BB_UNITY_WEIGHT_UNSIGNED;
}

if (varTypeIsGC(dsc1->TypeGet()))
Expand Down

0 comments on commit 4de28f3

Please sign in to comment.