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

Remove an unnecessary check from fgMakeOutgoingStructArgCopy. #35701

Merged
merged 1 commit into from
May 1, 2020
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: 1 addition & 5 deletions src/coreclr/src/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4811,10 +4811,6 @@ void Compiler::fgMakeOutgoingStructArgCopy(GenTreeCall* call,
// * (must not copy) If the call is a tail call, the use is a last use.
// We must skip the copy if we have a fast tail call.
//
// * (must copy) However the current slow tail call helper always copies
// the tail call args from the current frame, so we must copy
// if the tail call is a slow tail call.
//
// * (may not copy) if the call is noreturn, the use is a last use.
// We also check for just one reference here as we are not doing
// alias analysis of the call's parameters, or checking if the call
Expand All @@ -4826,7 +4822,7 @@ void Compiler::fgMakeOutgoingStructArgCopy(GenTreeCall* call,
const bool isTailCallLastUse = call->IsTailCall();
const bool isCallLastUse = (totalAppearances == 1) && !fgMightHaveLoop();
const bool isNoReturnLastUse = (totalAppearances == 1) && call->IsNoReturn();
if (!call->IsTailCallViaJitHelper() && (isTailCallLastUse || isCallLastUse || isNoReturnLastUse))
if (isTailCallLastUse || isCallLastUse || isNoReturnLastUse)
{
varDsc->setLvRefCnt(0, RCS_EARLY);
args->SetNode(lcl);
Expand Down