Skip to content

JIT: Refactor optOptimizeBoolsCondBlock to be table-driven#128964

Open
EgorBo wants to merge 3 commits into
dotnet:mainfrom
EgorBo:cleanup-opt-bools
Open

JIT: Refactor optOptimizeBoolsCondBlock to be table-driven#128964
EgorBo wants to merge 3 commits into
dotnet:mainfrom
EgorBo:cleanup-opt-bools

Conversation

@EgorBo
Copy link
Copy Markdown
Member

@EgorBo EgorBo commented Jun 3, 2026

Refactors OptBoolsDsc::optOptimizeBoolsCondBlock from a long if/else cascade into a small table-driven matcher, plus a few drive-by cleanups in the same file.

Copilot AI review requested due to automatic review settings June 3, 2026 22:34
@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 Jun 3, 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the CoreCLR JIT boolean-conditional folding logic in OptBoolsDsc::optOptimizeBoolsCondBlock by replacing a nested if/else cascade with a small rule table and lookup, along with several small cleanups in the same compilation unit.

Changes:

  • Introduces a table-driven matcher (OptBoolsRule + s_optBoolsRules) to select (foldOp, cmpOp) based on adjacent BBJ_COND block patterns, including a normalization step to reuse the same table for both m_sameTarget cases.
  • Replaces ad-hoc debug printing with existing JITDUMP / DISPSTMT macros in the modified optimization path(s).
  • Performs small cleanups in optimizebools.cpp (e.g., log prefix fix, local cleanup, minor boolean/const handling tweaks).

Comment thread src/coreclr/jit/optimizebools.cpp
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants