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

Fix isByteReg() assert for x86 #48830

Merged
merged 3 commits into from
Mar 3, 2021
Merged

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

var_types type = varDsc->TypeGet();

#ifdef TARGET_X86
if (varTypeIsByte(type))
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be correct to add this logic into allRegs(type) instead?

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 sounds to be appropriate fix, but currently there are too many usage of allRegs(type) and I am not sure how that suggestion would impact other flows. My recommendation is to get this fix and generalize it in future if we find more cases like this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add an assert to allRegs(type) that type != TYP_BYTE to see if any other calls are impacted, if it fails then it should show other existing issues.

Copy link
Contributor

@sandreenko sandreenko left a comment

Choose a reason for hiding this comment

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

LGTM with a follow-up analysis.

var_types type = varDsc->TypeGet();

#ifdef TARGET_X86
if (varTypeIsByte(type))
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add an assert to allRegs(type) that type != TYP_BYTE to see if any other calls are impacted, if it fails then it should show other existing issues.

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

@sandreenko - That sounds reasonable. Let me try that out and run jitstressregs jobs.

@kunalspathak
Copy link
Member Author

kunalspathak commented Mar 3, 2021

@sandreenko - That sounds reasonable. Let me try that out and run jitstressregs jobs.

Looks like we hit the assert while compiling System.Private.CoreLib.dll so looks like we need more deeper analysis on right place to generalize it. Here are the failures. The failures happen during register allocation's build interval, so perhaps we use int register and then, during later phase, downcast to byte. I will revert the assert and merge this PR.

@kunalspathak kunalspathak merged commit 854cd48 into dotnet:main Mar 3, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 2, 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

3 participants