Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix physical promotion scenario name and a couple of bugs #85343

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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