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

[Linux-arm] Do not add resolution move in BBCallAlwaysPairTail #48828

Merged
merged 3 commits into from
Mar 2, 2021

Conversation

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 26, 2021
@kunalspathak
Copy link
Member Author

@dotnet/jit-contrib

// In such case, mark that we do not want to insert resolution moves in it.
if (block->bbPreds == nullptr && block->isBBCallAlwaysPairTail())
{
blockInfo[block->bbNum].hasEHBoundaryIn = true;
Copy link
Member

Choose a reason for hiding this comment

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

You might note this is a bit of a subterfuge, as this block has no flow whatsoever.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, agree and since we never had a flow, we were not entering the for loop above. However, thought it would be good to have the logic (that is inside for loop for isBBCallAlwaysPairTail()) outside the loop for no flow scenarios.

src/coreclr/jit/lsra.cpp Outdated Show resolved Hide resolved
@@ -887,6 +887,17 @@ void LinearScan::setBlockSequence()
}
}

#if defined(FEATURE_EH_FUNCLETS) && defined(TARGET_ARM)
Copy link
Member

Choose a reason for hiding this comment

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

This code seems odd to me, since we're already handling the callfinally/always pair stuff in the loop above, for all platforms. But the code above is weird because the condition is loop-invariant. It seems like we should just hoist:

            // We treat BBCallAlwaysPairTail blocks as having EH flow, since we can't
            // insert resolution moves into those blocks.
            if (block->isBBCallAlwaysPairTail())
            {
                blockInfo[block->bbNum].hasEHBoundaryIn  = true;
                blockInfo[block->bbNum].hasEHBoundaryOut = true;
            }

above the pred loop (for all platforms), and then replace it in the loop with:

if (!block->isBBCallAlwaysPairTail())
   ...

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good point. Fixed.

Base automatically changed from master to main March 1, 2021 09:08
Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

LGTM

@kunalspathak kunalspathak merged commit e0b8c2e into dotnet:main Mar 2, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 1, 2021
@JulieLeeMSFT JulieLeeMSFT added this to the 6.0.0 milestone Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants