Skip to content

Conversation

@BruceForstall
Copy link
Contributor

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
@ghost ghost 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
Contributor 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
Contributor Author

@EgorBo @dotnet/jit-contrib PTAL

@BruceForstall
Copy link
Contributor 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