Skip to content

JIT: Clean up comments and remove redundancy in flowgraph.cpp#125292

Merged
AndyAyersMS merged 2 commits intodotnet:mainfrom
AndyAyersMS:CleanupFlowgraph
Mar 9, 2026
Merged

JIT: Clean up comments and remove redundancy in flowgraph.cpp#125292
AndyAyersMS merged 2 commits intodotnet:mainfrom
AndyAyersMS:CleanupFlowgraph

Conversation

@AndyAyersMS
Copy link
Copy Markdown
Member

  • Add missing header comments to fgIsBlockCold, fgGetSharedCCtor, fgCastNeeded, and fgGetCritSectOfStaticMethod
  • Standardize informal comments on fgCreateMonitorTree and fgConvertSyncReturnToLeave to use the modern header format
  • Convert old-style /*** comments to modern //-------- format for fgIsThrow, fgInDifferentRegions, fgIsCommaThrow, fgAddSyncMethodEnterExit, fgMoreThanOneReturnBlock, and fgInsertFuncletPrologBlock
  • Fix incorrect header on fgGetStaticsCCtorHelper (said BasicBlock, returns GenTreeCall) and IsDecreasingLoop (header said IsIncreasingLoop)
  • Fix typos: helepr, depents, openrand, querstion, desinator, enclsoing, domnates
  • Use block->KindIs(BBJ_SWITCH) instead of Yoda comparison for consistency
  • Remove redundant second VisitDefs walk in AnalyzeIteration that duplicates the check already performed in the exit edge loop

- Add missing header comments to fgIsBlockCold, fgGetSharedCCtor,
  fgCastNeeded, and fgGetCritSectOfStaticMethod
- Standardize informal comments on fgCreateMonitorTree and
  fgConvertSyncReturnToLeave to use the modern header format
- Convert old-style /*** comments to modern //-------- format for
  fgIsThrow, fgInDifferentRegions, fgIsCommaThrow,
  fgAddSyncMethodEnterExit, fgMoreThanOneReturnBlock, and
  fgInsertFuncletPrologBlock
- Fix incorrect header on fgGetStaticsCCtorHelper (said BasicBlock,
  returns GenTreeCall) and IsDecreasingLoop (header said IsIncreasingLoop)
- Fix typos: helepr, depents, openrand, querstion, desinator, enclsoing,
  domnates
- Use block->KindIs(BBJ_SWITCH) instead of Yoda comparison for consistency
- Remove redundant second VisitDefs walk in AnalyzeIteration that
  duplicates the check already performed in the exit edge loop

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 7, 2026 16:41
@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 7, 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.

@AndyAyersMS
Copy link
Copy Markdown
Member Author

Realized before I only did clean up on fg*.cpp... so now adding in flowgraph.cpp.

@jakobbotsch PTAL. In particular look at the change in AnalyzeIteration, copilot claims the removed computation was fully redundant.

No diffs.

@dotnet/jit-contrib FYI

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 improves readability and maintainability of the CoreCLR JIT flowgraph implementation by modernizing function header comments, fixing typos, standardizing minor style inconsistencies, and removing redundant analysis work in natural loop iteration analysis.

Changes:

  • Convert/standardize a number of function headers and inline comments to the modern comment format and fix several typos.
  • Make a small consistency tweak in fgInsertGCPolls() by using block->KindIs(BBJ_SWITCH) instead of a Yoda comparison.
  • Remove a redundant VisitDefs walk in FlowGraphNaturalLoop::AnalyzeIteration() that duplicated an equivalent check already performed earlier in the method.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 7, 2026 17:37
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

@AndyAyersMS AndyAyersMS merged commit 4694968 into dotnet:main Mar 9, 2026
133 of 135 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

3 participants