-
Notifications
You must be signed in to change notification settings - Fork 10.5k
ARCSequenceOpts: Add LoopSummary verifier #33810
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
@swift-ci test |
@swift-ci benchmark |
@swift-ci Please Test Source Compatibility |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -Osize
Performance: -Onone
Code size: -swiftlibsHow to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
#ifndef NDEBUG | ||
// Verify updateForDifferentLoopInst is conservative enough that the flow | ||
// sensitive native of the loop summarized instructions does not matter. | ||
if (verifyARCLoopSummary) { |
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.
Is this verification inside the loop over SummarizedInterestingInsts? Shouldn't it be outside? Otherwise it's unnecessarily quadratic
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.
Thanks. I fixed it.
0db4137
to
e1cc16e
Compare
@swift-ci test |
ARCSequenceOpts with loop support works on regions inside out. While processing an outer region, it uses summary from the inner loop region to compute RefCountState transitions used for CodeMotionSafe optimization. We do not compute the loop summary by iterating over it twice or iterating until a fixed point is reached. Instead loop summary is just a list of refcount effecting instructions. And BottomUpRefCountState::updateForDifferentLoopInst and TopDownRefCountState::updateForDifferentLoopInst are used to compute the RefCountState transition when processing the inner loop region. These functions are very conservative and the flow sensitive nature of the summarized instructions do no matter. This PR adds a verifying assert to confirm this.
e1cc16e
to
ee19299
Compare
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. But I think you should kick off another build of the tests, benchmarks and SCK after the latest change in case that changes the semantics.
@swift-ci test |
@swift-ci Please Test Source Compatibility |
Build failed |
Build failed |
Errors in sck are all known SILGen bugs. |
ee19299
to
908ad5d
Compare
Removed commit for testing |
@swift-ci smoke test |
@swift-ci smoke test Linux platform |
@swift-ci smoke test OSX platform |
@swift-ci smoke test OS X platform |
1 similar comment
@swift-ci smoke test OS X platform |
* 'master' of github.com:apple/swift: [docs] Fix broken links in the documentation index (#33829) [Profiler] Increment closure body count prior to the prolog (#33946) ARCSequenceOpts: Add LoopSummary verifier (#33810) [build-script] Cleanup source directory layout help Address review comment. ABI checker: when invoking via build system, explicitly mention ABI breakge in diagnostics stdlib: Remove unused, unsafe helper function _withUninitializedString (#33704) test: Replace _silgen_name w/ _cdecl in CommandLineStressTest [AutoDiff] [Docs] Clarify 'Differentiable' derived conformances conditions. Revert "build-script: remove dead CMake options for Swift"
ARCSequenceOpts with loop support works on regions inside out. While processing an outer region, it uses summary from
the inner loop region to compute RefCountState transitions used for CodeMotionSafe optimization.
We do not compute the loop summary by iterating over it twice or iterating until a fixed point is reached.
Instead loop summary is just a list of refcount affecting instructions. And BottomUpRefCountState::updateForDifferentLoopInst and TopDownRefCountState::updateForDifferentLoopInst are used to compute the RefCountState transition when processing the inner loop region. These functions are very conservative and the flow sensitive nature of the summarized instructions do no matter.
This PR adds a verifying assert to confirm this.