Skip to content

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented May 31, 2025

The definition was not updated, leading to invalid optimizations later on.

Fixes invalid optimized compilation of VectorTest:F2_v2 from runtime tests.

…during cprop

The definition was not updated, leading to invalid optimizations later on.
@Copilot Copilot AI review requested due to automatic review settings May 31, 2025 16:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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

Copy link
Contributor

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

@BrzVlad BrzVlad merged commit 567505f into dotnet:main Jun 4, 2025
71 checks passed
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.
@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants