Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Copy propagation needs to propagate variables, not values #64700

Closed
SingleAccretion opened this issue Feb 2, 2022 · 1 comment · Fixed by #64701
Closed

Copy propagation needs to propagate variables, not values #64700

SingleAccretion opened this issue Feb 2, 2022 · 1 comment · Fixed by #64701
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI bug
Milestone

Comments

@SingleAccretion
Copy link
Contributor

SingleAccretion commented Feb 2, 2022

Copy propagation today can substitute uses with live defs of locals. In doing so, it compares the value number of the def to the value of the use as a LCL_VAR. This is not correct because of zero-offset field sequences. Consider:

var a1 = addr; // Zero [FldSeq]
var a2 = addr; // No FldSeq

use LCL_VAR a2 Zero [FldSeq] // Attached to the node itself

If we replace the use with a1, then on renumbering (under JitOptRepeat) we will have a duplicated sequence.

@dotnet-issue-labeler dotnet-issue-labeler bot added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner labels Feb 2, 2022
@ghost
Copy link

ghost commented Feb 2, 2022

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

Issue Details

Copy propagation today can substitute uses with live defs of locals. In doing so, it compares the value number of the local's def to the value of the use as a LCL_VAR. This is not correct because of zero-offset field sequences. Consider:

var a1 = addr; // Zero [FldSeq]
var a2 = addr; // No FldSeq

use LCL_VAR a2 Zero [FldSeq] // Attached to the node itself

If we replace the use with a1, then on renumbering (under JitOptRepeat) we will have a duplicated sequence.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr, untriaged

Milestone: -

@SingleAccretion SingleAccretion changed the title Copy propagation needs to propagate locations, not values Copy propagation needs to propagate variables, not values Feb 2, 2022
@SingleAccretion SingleAccretion added bug and removed untriaged New issue has not been triaged by the area owner labels Feb 2, 2022
@SingleAccretion SingleAccretion added this to the 7.0.0 milestone Feb 2, 2022
@SingleAccretion SingleAccretion self-assigned this Feb 2, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Feb 2, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Feb 8, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 10, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant