-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Tweak FSO explosion heuristics #16756
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
59741ef
to
5c9616e
Compare
@swift-ci smoke test |
@swift-ci performance |
or actually I should make sure it actually compiles first I guess before seeing code-size numbers. |
Something we may want to try later as well is if we have a large non-trivial type only whose trivial parts are used, we could create a new struct that only contains those trivial leaf parts (maybe flattened?) and just pass those in. We won't have the code-size impact from creating many arguments since we aren't creating many arguments and the IRGen passes should still be able to change it to be passed by pointer. Getting rid of the ARC overhead for such structs would improve performance. |
2381324
to
88c0508
Compare
Finishing this up. |
3b8ffe3
to
41ea273
Compare
Some notes for those watching:
|
@swift-ci smoke test |
1 similar comment
@swift-ci smoke test |
Some data. This reduces the amount of FSO thunks in the stdlib by 20%. In Benchmark_O it reduces it by 16%. |
41ea273
to
098003c
Compare
@swift-ci smoke test |
1 similar comment
@swift-ci smoke test |
@swift-ci smoke compiler performance |
1 similar comment
@swift-ci smoke compiler performance |
@swift-ci smoke test compiler performance |
1 similar comment
@swift-ci smoke test compiler performance |
NOTE I am expecting a few fso test failures since I need to re-update the tests. |
@swift-ci test compiler performance |
1 similar comment
@swift-ci test compiler performance |
@swift-ci smoke benchmark |
In the future, when we support specializing vtables and witness tables this will become a different question. But for today, this is correct.
42c59f5
to
4429861
Compare
Found the problem! |
@swift-ci test compiler performance |
Build comment file:Summary for master fullUnexpected test results, excluded stats for Core, xcproj, StencilSwiftKit, CoreStore, Turnstile, ObjectMapper Regressions found (see below) Debug-batchdebug-batch briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
debug-batch detailedRegressed (2)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (78)
Releaserelease briefRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (2)
release detailedRegressed (0)
Improved (0)
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
|
@graydon Question. Is there scripting/facilities for gathering this data per project? I would like to get a more finer grained picture here and would rather not script it myself if you already have something. = ). |
The new rule on the basis of which an argument will be exploded is that an argument will be exploded if the following conditions hold: (1) The argument has greater than zero and less than or equal to three live leaves. (2) The argument has greater than zero non-trivial leaves. This change is based heavily on @GottesM's swiftlang#16756 . rdar://problem/39957093
Added getAllLeafTypes to ProjectionTree. The new method vends, via an out paramter, a vector containing the types of all the leaves in a projection tree in the order that they appear. The method relies uses a new convenience on ProjectionTreeNode, isLeaf to include only the types of those nodes which are leaves. Excerpted from @GottesM's swiftlang#16756.
Added getUsers to ProjectionTree. The new method vands, via an out parameter, a set of all the users of all of the nodes in the projection tree that are themselves not in the projection tree by way of getNonProjUsers. Took this opportunity to tweak getNonProjUsers to vend a const ArrayRef rather than a SmallVector. Excerpted from @GottesM's swiftlang#16756.
…leases. Added getPartiallyPostDomReleaseSet to ConsumedArgToEpilogueReleaseMatcher. Given an argument, the new method returns the array of releases of the argument if there is an array thereof and if the releases therein do not jointly post-dominate the argument. Excerpted from @GottesM's swiftlang#16756.
Replaced some namespace qualified references to ArrayRef and Optional with the unqualified type. Reordered the includes per clang-format. Excerpted from @GottesM's swiftlang#16756.
The new rule is that an argument will be exploded if one of the following sets of conditions hold: (1) (a) Specializing the function will result in a thunk. That is, the thunk that is generated cannot be inlined everywhere. (b) The argument has dead non-trivial leaves. (c) The argument has fewer than three live leaves. (2) (a) Specializing the function will not result in a thunk. That is, the thunk that is generated will be inlined everywhere and eliminated as dead code. (b) The argument has dead potentially trivial leaves. (c) The argument has fewer than six live leaves. This change is based heavily on @GottesM's swiftlang#16756 . rdar://problem/39957093
This is still in progress.
rdar://39957093