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: Skip cost improvement check in 3-opt for exceptionally costly layouts #110069

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

amanasifkhalid
Copy link
Member

Fixes #109984.

@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 Nov 21, 2024
@@ -4927,21 +4927,33 @@ Compiler::ThreeOptLayout::ThreeOptLayout(Compiler* comp)
// endPos - The inclusive ending index of the region
//
// Returns:
// The region's layout cost
// The region's layout cost, or 'BB_MAX_WEIGHT' for pathalogically costly layouts
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// The region's layout cost, or 'BB_MAX_WEIGHT' for pathalogically costly layouts
// The region's layout cost, or 'BB_MAX_WEIGHT' for pathologically costly layouts

@amanasifkhalid
Copy link
Member Author

/azp run runtime-coreclr libraries-jitstress, Antigen

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link

@mslovelymia mslovelymia left a comment

Choose a reason for hiding this comment

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

dont wanna approve anything

@amanasifkhalid
Copy link
Member Author

/azp run runtime-coreclr libraries-jitstress

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@amanasifkhalid amanasifkhalid changed the title JIT: Detect and handle imprecision in 3-opt layout cost computation JIT: Skip cost improvement check in 3-opt for exceptionally costly layouts Nov 22, 2024
@amanasifkhalid amanasifkhalid marked this pull request as ready for review November 22, 2024 18:32
@amanasifkhalid
Copy link
Member Author

cc @dotnet/jit-contrib, @AndyAyersMS PTAL. libraries-jitstress failures don't look related. For the cases I looked at, the failure in #109984 only seems to hit under JitOptRepeat stress scenarios where optSetBlockWeights inflates loop block weights, thus causing the layout cost calculation to lose precision when summing large values. The simplest solution seems to be to skip the assertion if we detect that we're dealing with some pathologically large layout cost.

@amanasifkhalid
Copy link
Member Author

/ba-g Linux-arm64 NativeAOT build timed out.

@amanasifkhalid amanasifkhalid merged commit 4045d1b into dotnet:main Nov 22, 2024
108 of 115 checks passed
@amanasifkhalid amanasifkhalid deleted the fix-3-opt-assert-pt2 branch November 22, 2024 19:57
mikelle-rogers pushed a commit to mikelle-rogers/runtime that referenced this pull request Dec 10, 2024
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
4 participants