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

Make bounds check nodes ordinary binary opers #59963

Merged

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Oct 4, 2021

There is no real reason why they cannot be, and making them binary enables the deletion of some custom traversal code:

+179 −508

Outdated

It also enables GTF_REVERSE_OPS, though the diffs from that appear to be mixed at best (they're all due to different register allocation, as one would expect). But it did not seem worth it to quirk anything, as they are also small. I've spent quite a bit of time checking various regressions for obvious bad costing (causing said regressions), but did not find anything notable.

The aforementioned diffs: win-x64, win-arm64, win-x86, linux-arm (the most affected target due to the flakiness of 16 vs 32 bit encodings).

The bounds check node has also been made small, because there's nothing preventing it from being small. This saves a little bit of memory: -0.033% when prejitting CoreLib.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Oct 4, 2021
@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 Oct 4, 2021
@ghost
Copy link

ghost commented Oct 4, 2021

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

Issue Details

There is no real reason why they cannot be, and making them enables the deletion of some custom traversal code:

206 insertions(+), 514 deletions(-)

It also enables GTF_REVERSE_OPS, though the diffs from that appear to be mixed at best. But it did not seem worth it to quirk anything, as they are also small.

The aforementioned diffs: pending.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

@SingleAccretion SingleAccretion force-pushed the Make-Bounds-Checks-Simple-BinOps branch 3 times, most recently from 3bebae9 to 3d3f36b Compare October 4, 2021 22:31
@SingleAccretion SingleAccretion marked this pull request as ready for review October 5, 2021 00:44
@SingleAccretion
Copy link
Contributor Author

@dotnet/jit-contrib

@SingleAccretion SingleAccretion force-pushed the Make-Bounds-Checks-Simple-BinOps branch from 3d3f36b to 88cddac Compare October 8, 2021 15:27
There is no real reason why they cannot be, and making
them enables the deletion of some custom traversal code.

It also enables GTF_REVERSE_OPS, though the diffs from
that appear to be mixed at best. But it did not seem
worth it to quirk anything, as they are also small.
@SingleAccretion SingleAccretion force-pushed the Make-Bounds-Checks-Simple-BinOps branch from 88cddac to 8e81de0 Compare October 8, 2021 18:35
@AndyAyersMS
Copy link
Member

How hard would it be to get this to a zero-diff change? Would it just involve blocking GTF_REVERSE_OPS?

I'd rather not see a refactoring change that also alters behavior.

To get to zero diffs.

Additionally, the less GTF_REVERSE_OPS we have, the better.
They are no longer needed now that
GTF_REVERSE_OPS has been disabled.

Note that these changes were CQ-only, i. e. in the
event that some odd code sets GTF_REVERSE_OPS on the
bounds checks nodes, everything will still work correctly.
To get to zero diffs.
@SingleAccretion
Copy link
Contributor Author

I'd rather not see a refactoring change that also alters behavior.

Agree, bad judgement on my part. The latest commits contain changes making this strictly zero-diff across all of SPMI.

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

LGTM.

Thanks for changing this into a pure refactor.

@AndyAyersMS AndyAyersMS merged commit 881ee50 into dotnet:main Oct 19, 2021
@SingleAccretion SingleAccretion deleted the Make-Bounds-Checks-Simple-BinOps branch October 19, 2021 16:11
@ghost ghost locked as resolved and limited conversation to collaborators Nov 18, 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 community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants