Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions src/coreclr/jit/async.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1071,24 +1071,29 @@ void AsyncTransformation::LiftLIREdges(BasicBlock* block,

for (GenTree* tree : defs)
{
// TODO-CQ: Enable this. It currently breaks our recognition of how the
// call is stored.
// if (tree->OperIs(GT_LCL_VAR))
//{
// LclVarDsc* dsc = m_compiler->lvaGetDesc(tree->AsLclVarCommon());
// if (!dsc->IsAddressExposed())
// {
// // No interference by IR invariants.
// LIR::AsRange(block).Remove(tree);
// LIR::AsRange(block).InsertAfter(beyond, tree);
// continue;
// }
//}

LIR::Use use;
bool gotUse = LIR::AsRange(block).TryGetUse(tree, &use);
assert(gotUse); // Defs list should not contain unused values.

if (tree->IsInvariant())
{
LIR::AsRange(block).Remove(tree);
LIR::AsRange(block).InsertBefore(use.User(), tree);
continue;
}

if (tree->OperIs(GT_LCL_VAR))
{
LclVarDsc* dsc = m_compiler->lvaGetDesc(tree->AsLclVarCommon());
if (!dsc->IsAddressExposed())
{
// No interference by IR invariants
LIR::AsRange(block).Remove(tree);
LIR::AsRange(block).InsertBefore(use.User(), tree);
continue;
}
}

unsigned newLclNum = use.ReplaceWithLclVar(m_compiler);
layoutBuilder->AddLocal(newLclNum);
GenTree* newUse = use.Def();
Expand Down
Loading