Skip to content

Conversation

@atrick
Copy link
Contributor

@atrick atrick commented Apr 7, 2023

This now supports liveness holes within blocks where previously we
expected a phi def.

PrunedLiveness is streamlined for SSA liveness where we expect the
defs and uses to be related in the SSA def-use graph.
MultiDefPrunedLiveness was added on top of SSAPrunedLivenes to handle
extended SSA liveness that occurs with phis, but are still connected
in the def-use graph. Recently MultiDefPrunedLiveness was repurposed
for liveness of addressible storage. This means that we can now have
uses before defs in the same block without a corresponding phi.

Fortunately, handling this case is a straightforward extension of
MultiDefPrunedLiveness that does not complicate or penalize the
streamlined SSA case.

Fixes rdar://107740403 ([move-only] Add support for addressable values in MultiDefPrunedLiveness)

@atrick atrick requested a review from a team as a code owner April 7, 2023 03:47
@atrick
Copy link
Contributor Author

atrick commented Apr 7, 2023

@swift-ci test

@atrick atrick force-pushed the 5.9-fix-liveblocks branch from 095f927 to 1968d00 Compare April 7, 2023 05:18
@atrick
Copy link
Contributor Author

atrick commented Apr 7, 2023

@swift-ci test

atrick added 8 commits April 7, 2023 10:41
Because it doesn't really hold a "string".
We need this for specifications that involve multiple components and long instruction lists.

(cherry picked from commit aa46954)
This provides a way to test liveness based on non-SSA values. The move
checker is now using pruned liveness this way. So we need a way to
test that liveness no longer makes any assumptions about SSA
values. These test cases need to explicitly specify all the def and
use instructions.

(cherry picked from commit 37ff9ad)
This was recently introduced as a result of rebasing commits. It never
did anything useful on the main branch.

(cherry picked from commit 20604ab)
(cherry picked from commit 927d526)
(cherry picked from commit 54d4082)
PrunedLiveness only knows about the live blocks and uses.

The PrunedLiveRange subclass is now responsible for updating liveness
based on both the defs and uses. This is in preparation for handling
non-SSA liveness when uses occur before the first def.

(cherry picked from commit d44c7f3)
This now supports liveness holes within blocks where previously we
expected a phi def.

PrunedLiveness is streamlined for SSA liveness where we expect the
defs and uses to be related in the SSA def-use graph.
MultiDefPrunedLiveness was added on top of SSAPrunedLivenes to handle
extended SSA liveness that occurs with phis, but are still connected
in the def-use graph. Recently MultiDefPrunedLiveness was repurposed
for liveness of addressible storage. This means that we can now have
uses before defs in the same block without a corresponding phi.

Fortunately, handling this case is a straightforward extension of
MultiDefPrunedLiveness that does not complicate or penalize the
streamlined SSA case.

Fixes rdar://107740403 ([move-only] Add support for addressable values
in MultiDefPrunedLiveness)

(cherry picked from commit c9eb1ae)
@atrick atrick force-pushed the 5.9-fix-liveblocks branch from 1968d00 to 8bca3f1 Compare April 7, 2023 17:41
@atrick
Copy link
Contributor Author

atrick commented Apr 7, 2023

@swift-ci test

@atrick
Copy link
Contributor Author

atrick commented Apr 8, 2023

@tbkka could you merge this if it looks ok to cherry-pick? It doesn't directly fix any bugs, but a bug could arise if future cherry-picks depend on the new behavior. And @gottesmm will need equivalent logic to check noncopyable types.

@tbkka tbkka merged commit feb5aa6 into swiftlang:release/5.9 Apr 8, 2023
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
@atrick atrick deleted the 5.9-fix-liveblocks branch July 5, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍒 release cherry pick Flag: Release branch cherry picks swift 5.9

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants