Skip to content

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

Merged
jakobbotsch merged 6 commits into
dotnet:mainfrom
jakobbotsch:loop-clone-terminology
Dec 7, 2023
Merged

JIT: Update terminology in loop cloning, and simplify a bit#95648
jakobbotsch merged 6 commits into
dotnet:mainfrom
jakobbotsch:loop-clone-terminology

Conversation

@jakobbotsch

Copy link
Copy Markdown
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`.
@ghostghost assigned jakobbotschDec 5, 2023
@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 5, 2023
@ghost

ghost commented Dec 5, 2023

Copy link
Copy Markdown

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:-

Comment threadsrc/coreclr/jit/loopcloning.cpp Outdated
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;

@jakobbotschjakobbotschDec 6, 2023

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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.

@BruceForstallBruceForstall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment threadsrc/coreclr/jit/loopcloning.cpp Outdated
@@ -2044,112 +2032,93 @@ void Compiler::optCloneLoop(FlowGraphNaturalLoop* loop, LoopCloneContext* contex
BasicBlock* h = preheader;

Copy link
Copy Markdown
Contributor

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
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

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

@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

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

Sure, looks like it was just merged.

@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

Closing and reopening to pick up #95718

@jakobbotschjakobbotsch reopened this Dec 7, 2023
@jakobbotsch
jakobbotsch merged commit dd8c3f8 into dotnet:mainDec 7, 2023
@jakobbotsch
jakobbotsch deleted the loop-clone-terminology branch December 7, 2023 14:31
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 7, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR 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

@jakobbotsch@BruceForstall