Skip to content

JIT: Fold same direction constant compares - #135562

Closed
Corniel wants to merge 1 commit into
dotnet:mainfrom
Corniel:jit-fold-same-directions
Closed

Corniel wants to merge 1 commit into
dotnet:mainfrom
Corniel:jit-fold-same-directions

Conversation

@Corniel

@Corniel Corniel commented Oct 10, 2026

Copy link
Copy Markdown

When #135421 was created to support folding ranges, I noticed there was a TODO in there for same direction compares. Although you would hope these kind of logic would not be fed to the JIP that often, it might be worth handling.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 10, 2026
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 10, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@EgorBo

EgorBo commented Oct 10, 2026

Copy link
Copy Markdown
Member

Thanks, but I don't think it needs to be fixed in that phase, it should be folded long before it.

@Corniel

Corniel commented Oct 10, 2026

Copy link
Copy Markdown
Author

Thanks, but I don't think it needs to be fixed in that phase, it should be folded long before it.

Shouldn't the TODO than not be updated to state that we assume this case not useful instead? The only reason to investigate this was the TODO.

@Corniel
Corniel force-pushed the jit-fold-same-directions branch from 716387b to 8c699a8 Compare October 11, 2026 22:32
@Corniel

Corniel commented Oct 11, 2026

Copy link
Copy Markdown
Author

@EgorBo Just updated the todo now. As you stated: should not occur.

@EgorBo

EgorBo commented Oct 16, 2026

Copy link
Copy Markdown
Member

I don't think that todo makes sense. What I meant is that if it doesn't happen, we should fix it in RBO - it's RBO's responsibility to fold redundant checks

@EgorBo

EgorBo commented Oct 16, 2026

Copy link
Copy Markdown
Member

Let's keep it as is then, I'll take a look at RBO when I have time

@EgorBo EgorBo closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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