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

Don't consider lvSpillAtSingleDef in WritesAnyLocation #78181

Merged
merged 1 commit into from
Nov 10, 2022
Merged
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
6 changes: 5 additions & 1 deletion src/coreclr/jit/sideeffects.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ class AliasSet final

if ((m_flags & ALIAS_WRITES_LCL_VAR) != 0)
{
// Stores to 'lvLiveInOutOfHndlr' locals cannot be reordered with
// exception-throwing nodes so we conservatively consider them
// globally visible.

LclVarDsc* const varDsc = m_compiler->lvaGetDesc(LclNum());
return varDsc->IsAlwaysAliveInMemory();
return varDsc->lvLiveInOutOfHndlr != 0;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked with @SingleAccretion on this fix.

The premise is that IsAlwaysAliveInMemory checks both lvLiveInOutOfHndlr and lvSpillAtSingleDef. The latter is only set in LSRA and shouldn't have any significance with regards to side effect checking since such spills can't interfere.

This solves the inconsistency between the check in lowering and the assert in codegen.

}

return false;
Expand Down