Skip to content

Fix an over-constrained use of a byte reg - #41004

Merged
CarolEidt merged 2 commits into
dotnet:masterfrom
CarolEidt:Fix40963
Aug 21, 2020
Merged

CarolEidt merged 2 commits into
dotnet:masterfrom
CarolEidt:Fix40963

Conversation

@CarolEidt

Copy link
Copy Markdown
Contributor

Fix #40963

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 18, 2020
Comment thread src/coreclr/src/jit/lsraxarch.cpp Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the actual fix.

Comment thread src/coreclr/src/jit/lsraxarch.cpp Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This and the other assert below are added because these are the only other semi-complex cases where we have byteable restrictions. I've convinced myself that we will never have more than 3 uses in these cases, so a simple assert is useful and sufficient (we don't need to check that we actually have a byteable register source).

@CarolEidt

Copy link
Copy Markdown
Contributor Author

@dotnet/jit-contrib PTAL
The remaining jitstressregs failures are #40607

@sandreenko sandreenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

question: could we replace 4 with a constant defined in target.h? Can it be calculated from:

  #define RBM_BYTE_REGS           (RBM_EAX|RBM_ECX|RBM_EDX|RBM_EBX)
  #define RBM_NON_BYTE_REGS       (RBM_ESI|RBM_EDI)

?

Also, side question, could you please clarify for me why RBM_NON_BYTE_REGS does not include ESP, EBP? It has only one use but could it be wrong?

@CarolEidt

Copy link
Copy Markdown
Contributor Author

could you please clarify for me why RBM_NON_BYTE_REGS does not include ESP, EBP? It has only one use but could it be wrong

I believe it's because we don't use ESP in the register allocator, and perhaps because EBP is sometimes restricted. IMO we should probably just eliminate RBM_NON_BYTE_REGS but I don't think it's critical.

@CarolEidt
CarolEidt merged commit a5b491c into dotnet:master Aug 21, 2020
@CarolEidt
CarolEidt deleted the Fix40963 branch August 21, 2020 01:37
@CarolEidt

Copy link
Copy Markdown
Contributor Author

/backport to release/5.0

@github-actions

github-actions Bot commented Sep 1, 2020

Copy link
Copy Markdown
Contributor

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

Assertion failed 'farthestRefPhysRegRecord != nullptr'

3 participants