Skip to content

Commit

Permalink
Fix physical promotion scenario name and a couple of bugs (#85343)
Browse files Browse the repository at this point in the history
This was renamed but I forgot to update these occurrences. The result is
that runtime-jit-experimental is not actually running with physical
promotion enabled.

Also fix a couple of bugs that made it in in the meantime.
  • Loading branch information
jakobbotsch committed Apr 26, 2023
1 parent 0bd15cb commit 2430618
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions eng/pipelines/common/templates/runtimes/run-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ jobs:
- jitpartialcompilation
- jitpartialcompilation_pgo
- jitobjectstackallocation
- jitgeneralizedpromotion
- jitgeneralizedpromotion_full
- jitphysicalpromotion
- jitphysicalpromotion_full

${{ if in(parameters.testGroup, 'jit-cfg') }}:
scenarios:
Expand Down
12 changes: 8 additions & 4 deletions src/coreclr/jit/promotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,12 +1099,11 @@ class ReplaceVisitor : public GenTreeVisitor<ReplaceVisitor>

if (srcDsc->lvPromoted)
{
unsigned fieldLcl = m_compiler->lvaGetFieldLocal(srcDsc, srcOffs);
LclVarDsc* fieldLclDsc = m_compiler->lvaGetDesc(fieldLcl);
unsigned fieldLcl = m_compiler->lvaGetFieldLocal(srcDsc, srcOffs);

if (fieldLclDsc->lvType == rep->AccessType)
if ((fieldLcl != BAD_VAR_NUM) && (m_compiler->lvaGetDesc(fieldLcl)->lvType == rep->AccessType))
{
srcFld = m_compiler->gtNewLclvNode(fieldLcl, fieldLclDsc->lvType);
srcFld = m_compiler->gtNewLclvNode(fieldLcl, rep->AccessType);
}
}

Expand Down Expand Up @@ -1300,6 +1299,11 @@ class ReplaceVisitor : public GenTreeVisitor<ReplaceVisitor>
// Overlap with last entry starting before offs.
firstIndex--;
}
else if (firstIndex >= replacements.size())
{
// Starts after last replacement ends.
return false;
}
}

const Replacement& first = replacements[firstIndex];
Expand Down

0 comments on commit 2430618

Please sign in to comment.