-
Notifications
You must be signed in to change notification settings - Fork 10.5k
MultiDefPrunedLiveness: add support for arbitrary uses/defs. #64926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This was recently introduced as a result of rebasing commits. It never did anything useful on the main branch.
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.
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.
preset=buildbot_incremental,tools=RA,stdlib=RA |
@swift-ci test |
@swift-ci benchmark |
@swift-ci test source compatibility |
Building with the incremental preset failed in a SwiftPM test unrelated to this change:
|
Source compat suite fails to build Doggie on main in SILGen. No new failures here.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
Restores PR: MultiDefPrunedLiveness: add support for arbitrary uses/defs. #64625
The CI failure in watchos RemoveWhere.o appears unrelated:
rdar://107341949 (Swift CI: [main, armv7k] benchmark/O-armv7k-apple-watchos2.0/RemoveWhere.o: assert in Control Flow Optimizer)