Skip to content

[RISC-V] Support displaying GTF_ADDRMODE_NO_CSE flag on GT_CAST#125516

Draft
namu-lee wants to merge 4 commits intodotnet:mainfrom
namu-lee:display-addrmod-nocse
Draft

[RISC-V] Support displaying GTF_ADDRMODE_NO_CSE flag on GT_CAST#125516
namu-lee wants to merge 4 commits intodotnet:mainfrom
namu-lee:display-addrmod-nocse

Conversation

@namu-lee
Copy link
Copy Markdown
Contributor

@namu-lee namu-lee commented Mar 13, 2026

Follow-up to #122088.
Add support to display the GTF_ADDRMODE_NO_CSE flag on GT_CAST.

Before

N024 (  2,  5) [000389] -----+---U-                               |           |     +--*  CAST      long <- uint $386

After

N024 (  2,  5) [000389] -----+-N-U-                               |           |     +--*  CAST      long <- uint $386

Part of #84834, cc @dotnet/samsung

Copilot AI review requested due to automatic review settings March 13, 2026 09:53
@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 Mar 13, 2026
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 13, 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

Updates CoreCLR JIT tree dumping so nodes marked with GTF_ADDRMODE_NO_CSE display as GTF_DONT_CSE (intended to help diagnose complex addressing-mode patterns, including those involving casts).

Changes:

  • Extends the gtDispNode flag printing logic to include GT_CAST when deciding to display GTF_ADDRMODE_NO_CSE as GTF_DONT_CSE.

You can also share your feedback on Copilot code review. Take the survey.

@namu-lee namu-lee marked this pull request as draft March 13, 2026 09:58
@namu-lee namu-lee force-pushed the display-addrmod-nocse branch from 2ffd698 to 5c49e6d Compare March 13, 2026 10:47
@namu-lee namu-lee marked this pull request as ready for review March 13, 2026 10:49
Copilot AI review requested due to automatic review settings March 13, 2026 10:49
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

Updates CoreCLR JIT tree dump formatting to better reflect address-mode-related “no CSE” markings, including when they occur on cast nodes.

Changes:

  • Extend gtDispNode’s flag-printing logic to consider IsPartOfAddressMode() nodes.
  • Treat GT_CAST similarly to GT_ADD/GT_MUL/GT_LSH for displaying the GTF_ADDRMODE_NO_CSE intent (printed as GTF_DONT_CSE).

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 13, 2026 11:11
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

This PR refactors JIT tree debug flag printing in Compiler::gtDispNode to use the existing GenTree::IsPartOfAddressMode() helper when deciding to display GTF_ADDRMODE_NO_CSE-marked nodes as GTF_DONT_CSE. This keeps address-mode-related behavior consistent with other parts of the JIT that already use IsPartOfAddressMode().

Changes:

  • Replace inline operator checks (GT_ADD/GT_MUL/GT_LSH + GTF_ADDRMODE_NO_CSE) with tree->IsPartOfAddressMode().
  • Preserve existing behavior for clearing GTF_REVERSE_OPS on non-binary/non-multiop nodes, while making the control flow slightly more direct.

You can also share your feedback on Copilot code review. Take the survey.

@JulieLeeMSFT
Copy link
Copy Markdown
Member

@namu-lee, please address test failures and convert this PR back when it is ready for review.

@JulieLeeMSFT JulieLeeMSFT marked this pull request as draft April 13, 2026 12:19
@jakobbotsch
Copy link
Copy Markdown
Member

Test failures were presumably CI issues, going to rerun CI

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.

4 participants