-
Notifications
You must be signed in to change notification settings - Fork 10.5k
ComputeSideEffects: compute properties even if function has an effect attribute #83665
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
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!
@swift-ci test |
@swift-ci apple silicon benchmark |
The 1 test failure on the macOS platform doesn't seem to be related to this change (WatchOS version issues), so it should be ok to merge anyway. |
@swift-ci test macos |
81d6e8b
to
8771877
Compare
@swift-ci apple silicon benchmark |
1 similar comment
@swift-ci apple silicon benchmark |
@swift-ci apple silicon benchmark |
@swift-ci test |
1 similar comment
@swift-ci test |
@swift-ci apple silicon benchmark |
@swift-ci apple silicon benchmark |
@swift-ci test |
7bb2a3c
to
aae3944
Compare
@swift-ci smoke test macOS |
@swift-ci smoke test linux |
@swift-ci smoke test macOS |
56c78c6
to
8897903
Compare
@swift-ci smoke test |
@swift-ci apple silicon benchmark |
SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift
Outdated
Show resolved
Hide resolved
After computing side effects, we also remove any global or argument effects that are computed to happen, but are defined not to, based on the effect attribute. This allows us to compute the deinit_barrier effect for such functions, fixing the test case here: rdar://155870190 This supercedes swiftlang#38324.
8897903
to
6a263f8
Compare
@swift-ci smoke test |
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
@swift-ci test windows |
@swift-ci test windows |
Currently, the compute-side-effects pass does nothing if a function has an effect attribute. This prevents certain optimisations, such as temporary lvalue elimination, from working for callers of such functions.
This is a naive fix, which will worsen the performance of the compute-side-effects pass by making it run of functions it wouldn't have otherwise.
For the test case this patch aims to fix, we only need to compute the isDeinitBarrier property. We could attempt to only store that property, but there is no benefit to this over storing all the computed side effect properties. The benefit of the previous behaviour was avoiding the overhead of computing any properties in the first place.
rdar://155870190
This aims to resolve the same problem as #38324.