Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Don't force byte regs for indir address#16727

Merged
CarolEidt merged 1 commit into
dotnet:masterfrom
CarolEidt:NoIndirByte
Mar 5, 2018
Merged

Don't force byte regs for indir address#16727
CarolEidt merged 1 commit into
dotnet:masterfrom
CarolEidt:NoIndirByte

Conversation

@CarolEidt
Copy link
Copy Markdown

No description provided.

@CarolEidt
Copy link
Copy Markdown
Author

This came up in the process of eliminating TreeNodeInfo (#16517). Indirections that load a byte value don't need a byte register for the address.
This change results in a net reduction of 4520 bytes (-0.01%) in jit-diffs (frameworks & tests). There are a small number of regressions due to different register allocation.

@CarolEidt
Copy link
Copy Markdown
Author

@dotnet/jit-contrib PTAL

Comment thread src/jit/lsraxarch.cpp
GenTree* op = tree->gtOp.gtOp1;
if (op != nullptr)
// We need byte registers on the operands of most simple operators that produce a byte result.
// However, indirections are simple operators but do not require their address in a byte register.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In which cases does indirection produce byte results?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If the indirection is loading a byte from memory (e.g. a field of a struct), it will be of type byte. The register it loads into must be a byte register, but the address need not be.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hmm, usually an indirection of type byte/ubyte will generate a movsx/movzx instruction. In that case you don't need a byte register, the destination register is really a 32 bit register.

Copy link
Copy Markdown

@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

@CarolEidt CarolEidt merged commit aea9340 into dotnet:master Mar 5, 2018
@CarolEidt CarolEidt deleted the NoIndirByte branch March 5, 2018 21:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants