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

Fix STRESS_64RSLT_MUL stress mode to avoid creating unnecessary IR #77871

Closed
wants to merge 1 commit into from

Conversation

BruceForstall
Copy link
Member

Issue #77152 is an assert in unoptimized code where the IR constructs an addressing mode from a tree including a GT_MUL with op2 of zero, hence it ignores op1, but then asserts because it only expects a limited set of IR nodes to be in the op1 tree.

This fixes this one particular case by avoiding creating the extra nodes in this stress mode. In normal optimized code, the MUL with zero would be folded.

Fixes #77152

Issue dotnet#77152 is an assert
in unoptimized code where the IR constructs an addressing mode
from a tree including a GT_MUL with op2 of zero, hence it ignores
op1, but then asserts because it only expects a limited set of
IR nodes to be in the op1 tree.

This fixes this one particular case by avoiding creating the extra
nodes in this stress mode. In normal optimized code, the MUL with
zero would be folded.

Fixes dotnet#77152
@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 3, 2022
@ghost ghost assigned BruceForstall Nov 3, 2022
@ghost
Copy link

ghost commented Nov 3, 2022

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

Issue Details

Issue #77152 is an assert in unoptimized code where the IR constructs an addressing mode from a tree including a GT_MUL with op2 of zero, hence it ignores op1, but then asserts because it only expects a limited set of IR nodes to be in the op1 tree.

This fixes this one particular case by avoiding creating the extra nodes in this stress mode. In normal optimized code, the MUL with zero would be folded.

Fixes #77152

Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@BruceForstall BruceForstall requested a review from EgorBo November 3, 2022 23:42
@BruceForstall
Copy link
Member Author

BruceForstall commented Nov 3, 2022

I wrote a more general fix at #77872. There should be no diffs from either, but the more general fix will have slightly more throughput impact. Not sure we need the generality.

@BruceForstall
Copy link
Member Author

@EgorBo @dotnet/jit-contrib PTAL

@BruceForstall
Copy link
Member Author

Went with the more general fix.

@BruceForstall BruceForstall deleted the Fix77152Simple branch November 9, 2022 01:45
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2022
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.

Assertion failed 'unused->OperIs(GT_CNS_INT)'
1 participant