Skip to content

JIT: Refactor CSE candidate storage slightly #116009

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

Merged

Conversation

jakobbotsch
Copy link
Member

CSE candidates had separate storage for the first candidate and subsequent candidates. This introduces some awkwardness when adding the second candidate to the list.

Refactor things so that the first candidate is stored inline in CSEDsc as a normal list entry.

Best reviewed with whitespace turned off.

CSE candidates had separate storage for the first candidate and
subsequent candidates. This introduces some awkwardness when adding the
second candidate to the list.

Refactor things so that the first candidate is stored inline in `CSEDsc`
as a normal list entry.
@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 May 27, 2025
Copy link
Contributor

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

@jakobbotsch jakobbotsch marked this pull request as ready for review May 27, 2025 14:29
@Copilot Copilot AI review requested due to automatic review settings May 27, 2025 14:29
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS

No diffs.

Copy link
Contributor

@Copilot 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

Refactor the storage of CSE candidates by replacing separate fields for the first occurrence (csdTree, csdStmt, csdBlock) with an inline tree statement list (csdTreeList).

  • Replace pointer fields with a value struct for the tree statement list in CSEdsc.
  • Update all references and iterations from direct csdTree access to csdTreeList.tslTree accordingly.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/coreclr/jit/optcse.h Updated CSEdsc structure to store the first candidate inline.
src/coreclr/jit/optcse.cpp Revised all accesses to use csdTreeList.tslTree and adjusted loops to iterate from the list head.

@jakobbotsch jakobbotsch merged commit e01d8f5 into dotnet:main May 28, 2025
107 of 109 checks passed
@jakobbotsch jakobbotsch deleted the refactor-cse-candidate-storage-slightly branch May 28, 2025 10:05
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