[mono][interp] Update var definition when inserting new instructions during cprop#116179
Merged
BrzVlad merged 1 commit intodotnet:mainfrom Jun 4, 2025
Merged
[mono][interp] Update var definition when inserting new instructions during cprop#116179BrzVlad merged 1 commit intodotnet:mainfrom
BrzVlad merged 1 commit intodotnet:mainfrom
Conversation
…during cprop The definition was not updated, leading to invalid optimizations later on.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue with constant propagation that led to invalid optimizations by ensuring that the variable definition is correctly updated when new instructions are inserted.
- Update the variable definition by setting td->var_values[ins->dreg].def to the new instruction in two places
- Clear the previous instruction to maintain consistency during constant propagation
Contributor
|
Tagging subscribers to this area: @BrzVlad, @kotlarmilos |
kotlarmilos
approved these changes
Jun 4, 2025
BrzVlad
added a commit
to BrzVlad/runtime
that referenced
this pull request
Jun 9, 2025
…during cprop (dotnet#116179) The definition was not updated, leading to invalid optimizations later on.
jozkee
pushed a commit
that referenced
this pull request
Jun 10, 2025
* [mono][interp] Add possibility to configure interp options from env var * [mono][interp] Update var definition when inserting new instructions during cprop (#116179) The definition was not updated, leading to invalid optimizations later on. * [mono][interp] Fix broken code attempting to reapply superinstruction optimization (#116069) For each instruction in a basic block we check for patterns. In a certain case, once we replaced the instruction with a new one, we were attempting to do a loop reiteration by setting `ins = ins->prev` so after the loop reincrements with `ins = ins->next` we check super instruction patterns again for the current instruction. This is broken if `ins` was the first instruction in a basic block, aka `ins->prev` is NULL. This used to be impossible before SSA optimizations, since super instruction pass was applying optimizations in a single basic block only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The definition was not updated, leading to invalid optimizations later on.
Fixes invalid optimized compilation of
VectorTest:F2_v2from runtime tests.