Skip to content

More flowgraph cleanup#125100

Open
AndyAyersMS wants to merge 7 commits intodotnet:mainfrom
AndyAyersMS:MoreFlowgraphCleanup
Open

More flowgraph cleanup#125100
AndyAyersMS wants to merge 7 commits intodotnet:mainfrom
AndyAyersMS:MoreFlowgraphCleanup

Conversation

@AndyAyersMS
Copy link
Member

  • ensure all method have header comments
  • remove /* */ comments unless in expression context

AndyAyersMS and others added 7 commits February 27, 2026 16:45
Convert old-style block comments to line comments across JIT
flowgraph source files. Comments within function argument lists,
template argument lists, and parameter default annotations are
intentionally preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add //-------- banners and standardized header comments to methods
that were missing them, following the JIT coding conventions format
(method name, description, arguments, return value).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add missing Arguments and Return Value sections to method headers
that had banners but were incomplete. Also fix typos in section
labels (Arguments; -> Arguments:, Returns Value: -> Returns:) and
a mismatched method name in a comment (FindCyclicProbabilities ->
ComputeCyclicProbabilities). Add proper banner header to the
standalone OperIsControlFlow function.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 3, 2026 02:29
@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 3, 2026
@AndyAyersMS
Copy link
Member Author

@dotnet/jit-contrib PTAL

I can see this sort of thing will quickly become tedious to review; on the other hand I would also like to see us fix up these sorts of things.

Thoughts...?

@dotnet-policy-service
Copy link
Contributor

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

Copy link
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 continues JIT flowgraph cleanup by standardizing function header comments and converting non-expression /* ... */ comments to // across several flowgraph-related source files.

Changes:

  • Added/expanded header comment blocks (Arguments/Returns/Notes) for a number of flowgraph-related helpers and phases.
  • Replaced many standalone /* ... */ comments with // comments to match the stated style direction.

Reviewed changes

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

Show a summary per file
File Description
src/coreclr/jit/fgwasm.cpp Adds missing “Return Value” section for a phase method comment block.
src/coreclr/jit/fgstmt.cpp Replaces block comments with structured headers and // comments for statement helpers.
src/coreclr/jit/fgprofilesynthesis.cpp Normalizes comment formatting (e.g., // static, Arguments: punctuation) and updates a header label.
src/coreclr/jit/fgprofile.cpp Adds missing Arguments/Returns sections to various profile-related methods.
src/coreclr/jit/fgopt.cpp Converts many /* ... */ comments to // and normalizes header wording.
src/coreclr/jit/fginline.cpp Adds missing Arguments sections and converts block comments to structured headers.
src/coreclr/jit/fgehopt.cpp Adds a “Return Value” section to a constructor header comment.
src/coreclr/jit/fgdiagnostic.cpp Adds structured headers and converts remaining block comments to line comments; minor comment refactors.
src/coreclr/jit/fgbasic.cpp Converts block comments to structured headers and replaces many /* ... */ comments with //.

/*****************************************************************************/

//------------------------------------------------------------------------
// fgCheckForInlineDepthAndRecursion: compute depth of the candidate, and
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The header comment name doesn't match the actual method name (fgCheckInlineDepthAndRecursion). This makes it harder to search/grep for documentation; update the comment to use the correct function name.

Suggested change
// fgCheckForInlineDepthAndRecursion: compute depth of the candidate, and
// fgCheckInlineDepthAndRecursion: compute depth of the candidate, and

Copilot uses AI. Check for mistakes.
Comment on lines +3017 to +3018
// Return Value:
// None (constructor). Initializes Traits and Visited members.
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

This is a constructor, so labeling a section as "Return Value" is misleading (constructors don't return values). Consider removing the Return Value section and moving this info to Notes/Remarks, or just omit it.

Suggested change
// Return Value:
// None (constructor). Initializes Traits and Visited members.
// Notes:
// Initializes Traits and Visited members.

Copilot uses AI. Check for mistakes.
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