Skip to content

Conversation

@AndyAyersMS
Copy link
Member

This gives us a single method that controls most of the jit's phase behavior.
Largely a manual inline, though I updated some comments and changed one assert.

Follow up from #1309; also see #2109.

This gives us a single method that controls most of the jit's phase behavior.
Largely a manual inline, though I updated some comments and changed one assert.

Follow up from dotnet#1309; also see dotnet#2109.
@AndyAyersMS
Copy link
Member Author

@dotnet/jit-contrib PTAL

Copy link
Contributor

@CarolEidt CarolEidt left a comment

Choose a reason for hiding this comment

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

LGTM, with minor comment suggestions

}

assert(!compDonotInline());
// By this point we are only jitting the root method (and not an inlinee)
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: I might reword this as "By this point we have completed inlining into the root method, so going forward we won't encounter any inlinees" or something like that.

Copy link
Member Author

Choose a reason for hiding this comment

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

At this point we haven't started inlining into the root method.

We run a few of the initial phases on inlinees. So inlinees and root methods both call compCompile. This comment is trying to say that "at this point in the phase list, all the inlinee phases have been run, and inlinee compiles have exited, so we should only get this far if we are jitting the root method."

If that quoted text seems better, let me know, and I'll update...

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that would be great - and thanks for clarifying!

fgDomsComputed = false;

/* Create LSRA before Lowering, this way Lowering can initialize the TreeNode Map */
// Create LSRA before Lowering, this way Lowering can initialize the TreeNode Map
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: since you're here, the TreeNode map is gone; I would reword this as something like "Create LinearScan before Lowering, so that Lowering can call LinearScan methods for determining whether locals are register candidates and (for xarch) whether a node is a containable memory op.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

NewBasicBlockEpoch();

/* Massage the trees so that we can generate code out of them */
// Start of the code that used to make up fgMorph
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd avoid mentioning what used to be, and instead encompass the comment below, to say something like: "Start of the code that is broadly called morphing, and includes global morph, as well as other phases that massage the trees so that we can generate code out of them."

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

@sandreenko sandreenko added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 23, 2020
@AndyAyersMS
Copy link
Member Author

Failures almost certainly unrelated.

Copy link
Contributor

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

Seems like we could simplify this even further as a further change by sinking checks and #ifdefs into phase / function calls, extracting functions for things like compGcChecks, etc., so the function ends up being almost entirely function calls to phase-like functions and EndPhase calls.

//
// Arguments:
// methodCodePtr [OUT] - address of generated code
// methodCodeSize [OUT] - size of the generated code (hot + cold setions)
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: setions

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks; will fix this in subsequent change.

@AndyAyersMS
Copy link
Member Author

Seems like we could simplify this even further

That's where I am headed (in gradual steps), see #2109...

@AndyAyersMS AndyAyersMS merged commit fe04356 into dotnet:master Jan 25, 2020
@AndyAyersMS AndyAyersMS deleted the MergeFgMorphIntoCompCompile branch January 25, 2020 00:19
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
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.

4 participants