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

Unpin locals, attempt 2 #70655

Merged
merged 2 commits into from
Jun 17, 2022
Merged
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions src/coreclr/jit/lclvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4712,8 +4712,6 @@ void Compiler::lvaComputeRefCounts(bool isRecompute, bool setSlotNumbers)
varDsc->setLvRefCnt(0);
varDsc->setLvRefCntWtd(BB_ZERO_WEIGHT);

varDsc->lvAllDefsAreNoGc = true;
aromaa marked this conversation as resolved.
Show resolved Hide resolved

// Special case for some varargs params ... these must
// remain unreferenced.
const bool isSpecialVarargsParam = varDsc->lvIsParam && raIsVarargsStackArg(lclNum);
Expand Down Expand Up @@ -4762,7 +4760,7 @@ void Compiler::lvaComputeRefCounts(bool isRecompute, bool setSlotNumbers)
varDsc->lvSingleDef = varDsc->lvIsParam;
varDsc->lvSingleDefRegCandidate = varDsc->lvIsParam;

varDsc->lvAllDefsAreNoGc = true;
varDsc->lvAllDefsAreNoGc = (varDsc->lvImplicitlyReferenced == false);
aromaa marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
varDsc->lvAllDefsAreNoGc = (varDsc->lvImplicitlyReferenced == false);
// if there are implicit refs, assume they may be gc defs
varDsc->lvAllDefsAreNoGc = !varDsc->lvImplicitlyReferenced;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This actually gives a compiler warning of "Using logical '!' when bitwise '~' was probably intended"

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, it's ok to leave this as is. For some reason all these bit fields are unsigned char and not bool.

}
}

Expand Down