Skip to content
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

JIT: Update terminology in loop cloning, and simplify a bit #95648

Merged
merged 6 commits into from
Dec 7, 2023

Conversation

jakobbotsch
Copy link
Member

Update some terminology in loop cloning; rewrite docs to be less "lexical" oriented; move maintenance of old preheader -> first cond link out of CondToStmtInBlock.

No diffs expected.

Update some terminology in loop cloning; rewrite docs to be less
"lexical" oriented; move responsibility of maintenance of old preheader
-> first cond link out of `CondToStmtInBlock`.
@ghost ghost assigned jakobbotsch Dec 5, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 5, 2023
@ghost
Copy link

ghost commented Dec 5, 2023

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

Issue Details

Update some terminology in loop cloning; rewrite docs to be less "lexical" oriented; move maintenance of old preheader -> first cond link out of CondToStmtInBlock.

No diffs expected.

Author: jakobbotsch
Assignees: jakobbotsch
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch jakobbotsch closed this Dec 5, 2023
@jakobbotsch jakobbotsch reopened this Dec 5, 2023
Comment on lines 2094 to 2099
// Make 'h' fall through to 'h2' (if it didn't already).
// Don't add the h->h2 edge because we're going to insert the cloning conditions between 'h' and 'h2', and
// optInsertLoopChoiceConditions() will add the edge.
h->SetJumpDest(h2);
assert(h->JumpsToNext());
h->bbFlags |= BBF_NONE_QUIRK;
Copy link
Member Author

@jakobbotsch jakobbotsch Dec 6, 2023

Choose a reason for hiding this comment

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

I thought this part was a bit odd -- we make h (now preheader) jump to h2 (now fastPreheader), then insert conditions between preheader and fastPreheader and make preheader jump to the first condition instead (which is done inside CondToStmtInBlock). It seemed like CondToStmtInBlock shouldn't be responsible for updating this link, so I've updated it so that we just leave preheader alone until the end of this function and then directly set it to jump to the first choice condition.

@jakobbotsch jakobbotsch marked this pull request as ready for review December 6, 2023 14:55
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @BruceForstall

No diffs

x64 superpmi-replay failure is the timeout we see once in a while. x86 failure is presumably the one fixed by #95671.

Copy link
Member

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

LGTM

@@ -2044,112 +2032,93 @@ void Compiler::optCloneLoop(FlowGraphNaturalLoop* loop, LoopCloneContext* contex
BasicBlock* h = preheader;
Copy link
Member

Choose a reason for hiding this comment

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

Is h still used?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, will remove it

@BruceForstall
Copy link
Member

This is going to conflict with #95139. Can you wait for that one?

@jakobbotsch
Copy link
Member Author

This is going to conflict with #95139. Can you wait for that one?

Sure, looks like it was just merged.

@jakobbotsch jakobbotsch closed this Dec 7, 2023
@jakobbotsch
Copy link
Member Author

Closing and reopening to pick up #95718

@jakobbotsch jakobbotsch reopened this Dec 7, 2023
@jakobbotsch jakobbotsch merged commit dd8c3f8 into dotnet:main Dec 7, 2023
129 checks passed
@jakobbotsch jakobbotsch deleted the loop-clone-terminology branch December 7, 2023 14:31
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2024
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.

2 participants