Skip to content

Conversation

jakobbotsch
Copy link
Member

optLocalHasNonLoopUses checks if a local might be used after a loop by making use of its liveness information, but it does not check lvTracked before doing so. This is generally not a problem as there are other checks that the local is in SSA, and normally SSA implies lvTracked, but that's not the case for locals put into SSA by CSE.

Since it is possible to have CSE defs in a loop with uses outside the loop, this check is necessary for correctness. It is expected to regress a bunch of IV opts cases, but in the future we can get those back by computing the necessary liveness when we insert into SSA.

`optLocalHasNonLoopUses` checks if a local might be used after a loop by
making use of its liveness information, but it does not check
`lvTracked` before doing so. This is generally not a problem as there
are other checks that the local is in SSA, and normally SSA implies
lvTracked, but that's not the case for locals put into SSA by CSE.

Since it is possible to have CSE defs in a loop with uses outside the
loop, this check is necessary for correctness. It is expected to regress
a bunch of IV opts cases, but in the future we can get those back by
computing the necessary liveness when we insert into SSA.
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 4, 2024
Copy link
Contributor

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

@jakobbotsch
Copy link
Member Author

I added this check in #106637 and identified it as the cause of regressions like #106637 (comment).

@jakobbotsch jakobbotsch marked this pull request as ready for review November 4, 2024 15:14
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS

Diffs.

I plan to add the necessary liveness computations as part of #106637, or maybe as a follow-up.

@jakobbotsch
Copy link
Member Author

/ba-g MacOS 12 brownout and infra timeouts

@jakobbotsch jakobbotsch merged commit 73e1976 into dotnet:main Nov 5, 2024
101 of 108 checks passed
@jakobbotsch jakobbotsch deleted the lvTracked-fix branch November 5, 2024 10:12
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2024
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.

2 participants