Skip to content

JIT: Clean up and unify SELECT opts#127621

Open
BoyBaykiller wants to merge 3 commits intodotnet:mainfrom
BoyBaykiller:cleanup-select-opts
Open

JIT: Clean up and unify SELECT opts#127621
BoyBaykiller wants to merge 3 commits intodotnet:mainfrom
BoyBaykiller:cleanup-select-opts

Conversation

@BoyBaykiller
Copy link
Copy Markdown
Contributor

My idea here is to make it easier to add SELECT transformations in the future and also call them from elsewhere in HIR if needed.

After this PR I want to add a few I think are impactful, but this PR should be zero-diff.

I also have the wish to get rid "optimizeBools" phase and implement it as just SELECT transformations (although this requires slight improvement in if-conversion itself)

I am also interested in moving the cost check after SELECT optimization, so costAfterOptSelect < costBranchful.
So that we transition to a view where if-conversions primary goal is to just simplify control flow and then let other opts profit from that.

* remove redundant select-to-cond opt in lower
@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 Apr 30, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Apr 30, 2026
@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.

@BoyBaykiller BoyBaykiller marked this pull request as ready for review May 1, 2026 01:05
@BoyBaykiller
Copy link
Copy Markdown
Contributor Author

@jakobbotsch PTAL. 0 diffs 0 tp impact. Just making things a little nicer

//
GenTree* OptIfConversionDsc::TryOptimizeSelect(GenTreeConditional* select)
{
if (GenTree* opt = TrySelectToCnsOpCond(select); opt != nullptr)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't use this style of declaration in the JIT.

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