Skip to content

Conversation

@BruceForstall
Copy link
Contributor

Every unwind fragment should be non-zero sized. If we consider
splitting on a boundary that would create a zero-sized fragment,
don't report that one. This only occurs when setting the
stress mode JitSplitFunctionSize to something small.

Every unwind fragment should be non-zero sized. If we consider
splitting on a boundary that would create a zero-sized fragment,
don't report that one. This only occurs when setting the
stress mode JitSplitFunctionSize to something small.
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 16, 2021
@ghost ghost assigned BruceForstall Dec 16, 2021
@ghost
Copy link

ghost commented Dec 16, 2021

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

Every unwind fragment should be non-zero sized. If we consider
splitting on a boundary that would create a zero-sized fragment,
don't report that one. This only occurs when setting the
stress mode JitSplitFunctionSize to something small.

Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

printf("%*s uwiComp: 0x%08p\n", indent, "", dspPtr(uwiComp));
printf("%*s ufiNext: 0x%08p\n", indent, "", dspPtr(ufiNext));
printf("%*s ufiEmitLoc: 0x%08p\n", indent, "", dspPtr(ufiEmitLoc));
printf("%*s ufiEmitLoc: 0x%08p ", indent, "", dspPtr(ufiEmitLoc));
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 was a useful change when I was debugging.

reportCandidate = false;
}

// Don't report a zero-size candidate. This will only occur in a stress mode with JitSplitFunctionSize
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also add an assert in Alloc() for

assert(this->ufiEmitLoc->GetIG()->igSize > 0);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which Alloc are you referring to?

Copy link
Contributor

@kunalspathak kunalspathak Dec 16, 2021

Choose a reason for hiding this comment

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

sorry, I meant Allocate() method, somewhere around here:

assert(endOffset > startOffset);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't have that assert, or any assert about the size of a particular IG, because the IG could be zero sized, as long as there are other IGs in the fragment that have code. That's what the endOffset > startOffset is asserting.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hhm, that's true. There could be other non-zero IGs in the fragment.

Copy link
Contributor

@kunalspathak kunalspathak left a comment

Choose a reason for hiding this comment

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

LGTM

@BruceForstall BruceForstall merged commit 6a8a583 into dotnet:main Dec 17, 2021
@BruceForstall BruceForstall deleted the Fix62250 branch December 17, 2021 01:54
@kunalspathak
Copy link
Contributor

I actually forgot to ask you, but can you add a test case for this?

@ghost ghost locked as resolved and limited conversation to collaborators Jan 16, 2022
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.

2 participants