Skip to content

JIT: Refactor post phase checks - #80194

Merged
AndyAyersMS merged 2 commits into
dotnet:mainfrom
AndyAyersMS:RefactorPostPhaseChecks
Jan 6, 2023
Merged

AndyAyersMS merged 2 commits into
dotnet:mainfrom
AndyAyersMS:RefactorPostPhaseChecks

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

Add finer-grained notions of what post-phase checks are enabled. Start checking some IR and FG invariants earlier than we did before.

This is largely done in anticipation of moving pred list building earlier (#80193). We should also consider moving some of the IR checking earlier as well.

Add finer-grained notions of what post-phase checks are enabled. Start checking
some IR and FG invariants earlier than we did before.

This is largely done in anticipation of moving pred list building earlier
(dotnet#80193). We should also consider moving some of the IR checking
earlier as well.
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 4, 2023
@ghost ghost assigned AndyAyersMS Jan 4, 2023
@ghost

ghost commented Jan 4, 2023

Copy link
Copy Markdown

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

Issue Details

Add finer-grained notions of what post-phase checks are enabled. Start checking some IR and FG invariants earlier than we did before.

This is largely done in anticipation of moving pred list building earlier (#80193). We should also consider moving some of the IR checking earlier as well.

Author: AndyAyersMS
Assignees: AndyAyersMS
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS

Copy link
Copy Markdown
Member Author

@BruceForstall PTAL
cc @dotnet/jit-contrib

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

Nice.

But it looks like maybe you've introduced a crash in R2R of SPC.dll?

@AndyAyersMS

Copy link
Copy Markdown
Member Author

Looks like optInit must happen for all compiler instances, not just root method instances. Odd that SPMI replay didn't catch this one.

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


fgInit();
lvaInit();
optInit();

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.

Seems fine, but presumably none of the optimizer phases run in the inliner-only Compiler, right? Was the new checking invoking checks related to optimizer data, during inlining?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The loop table checker is enabled after all phases and is supposed to decide when it should run. To do this It was reading optLoopCount which was not initialized for inlinee compilers.

Seemed like a good idea to just initialize it always.

@AndyAyersMS AndyAyersMS Jan 4, 2023 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

While we're on the topic, I wondered if I should just make all check enablement explicit and not rely on the the checks themselves to internally decide when they should run. Or convert the currently guarded checks to run always and internally decide when they actually checked things. So I left them both as is ....

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.

Atleast these checks which are always on?

 PhaseChecks::CHECK_EH | PhaseChecks::CHECK_LOOPS | PhaseChecks::CHECK_UNIQUE | PhaseChecks::CHECK_PROFILE;

@AndyAyersMS

Copy link
Copy Markdown
Member Author

Failure on linux arm64 checked looks like #70486. Am going to rerun.

@AndyAyersMS
AndyAyersMS merged commit 2fc497b into dotnet:main Jan 6, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Feb 6, 2023
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