-
Notifications
You must be signed in to change notification settings - Fork 10.5k
DeadObjectElimination: delete dead arrays for which the "destroyArray" builtin is inlined. #35737
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 |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -OnoneCode 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
|
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.
Fantastic. Thanks!
fyi, the OSSA SILCombine can be tested now, although I realize this is all about late inlining.
// Check if the store is within the range of the destroyed array. In OSSA | ||
// we would not need this check. Otherwise it would be a memory lifetime | ||
// failure. | ||
if (storePath.getOffset() < 0 || storePath.getOffset() >= numDestroyed) |
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.
Wow, I can't imagine how this check could be hit, but it doesn't hurt to check I guess.
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.
Yeah, it's not something which is ever generated from swift source, but in SIL it's legal.
Needed to remove unneeded reference counting for String literals.
…" builtin is inlined. This is needed for non-OSSA SIL: in case we see a destroyArray builtin, we can safely remove the otherwise dead array. This optimization kicks in later in the pipeline, after array semantics are already inlined (for early SIL, DeadObjectElimination can remove arrays based on semantics). rdar://73569282 https://bugs.swift.org/browse/SR-14100
The offset was not compared.
2d3b20a
to
1655e22
Compare
@swift-ci smoke test and merge |
Hi, I was looking at why the Android CI has been failing since https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android/9117/ and it seems to be because of the changes introduced in the test in this commit. No need to fix it or anything, I am just trying to understand the changes, and how it might be have affected only Android. This is the failure.
From my understanding of the test (and the JIRA ticket), it seems that the final value 21 is indeed created, but there's seems to be something in between constructing the return value and returning it, and the This is Android 32 bits (64 bits works fine), and if I understand correctly Darwin doesn't have a lot of 32 bits platforms lying around anymore, but https://github.com/apple/swift/pull/35737/files#diff-c34c7dab63c3329cf8671662271a8d64c1ee918eff414b91196fe5df89883265R259 looks like something that might not be true for a 32 bit platform. Any insight will be appreciated. If nobody have any idea, I can simply disable the test with an |
@drodriguez Thanks for letting me know! |
This is needed for non-OSSA SIL: in case we see a destroyArray builtin, we can safely remove the otherwise dead array.
This optimization kicks in later in the pipeline, after array semantics are already inlined (for early SIL, DeadObjectElimination can remove arrays based on semantics).
rdar://73569282
https://bugs.swift.org/browse/SR-14100