Skip to content

Conversation

@ghost ghost 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
Contributor 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
Contributor 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.

}
}

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

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
Contributor 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
Contributor

@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.

4 participants