-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Switch to swift calling conv #7237
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
Switch to swift calling conv #7237
Conversation
@swift-ci Please smoke test |
I think this deserves a full test! |
@jrose-apple Totally agree :-) |
@swift-ci Please smoke test linux platform |
@jrose-apple There is some local testing that I want to do before this should go in. At this time I will at the latest also run full test. |
In fact, I would even say a full clean test since you are making some cmake changes. |
@swift-ci Please smoke test linux platform |
16c3898
to
73be1f2
Compare
@swift-ci Please smoke test |
@swift-ci Please smoke test os x platform |
@swift-ci Please smoke test linux |
81729a2
to
a9a2944
Compare
@swift-ci Please smoke test os x platform |
@swift-ci Please smoke test linux platform |
@swift-ci Please clean test |
Build failed |
Build failed |
@swift-ci Please smoke test os x platform |
a9a2944
to
9c623f6
Compare
@swift-ci Please smoke test |
Use the generic type lowering algorithm described in "docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion type to the type expected by the ABI. Change IRGen to use the swift calling convention (swiftcc) for native swift functions. Use the 'swiftself' attribute on self parameters and for closures contexts. Use the 'swifterror' parameter for swift error parameters. Change functions in the runtime that are called as native swift functions to use the swift calling convention. rdar://19978563
9c623f6
to
6c35202
Compare
@swift-ci Please smoke test |
@swift-ci Please smoke test linux platform |
Did this ever pass the full tests? I assume so because there were no comments after the Wrong SHA failures, but it'd be nice to know for sure. |
Also, were there any major benchmark changes from this? |
Yes it passed the full test: https://ci.swift.org/job/swift-PR-osx/5542/ Unfortunately, I had to rebase after that. |
I did not measure significant changes in local testing. |
Looks like this broke the optimized tests: https://ci.swift.org/job/oss-swift_tools-RA_stdlib-RD_test-simulator/2738/
|
Taking a look |
@shahmishal @jrose-apple I think the os x smoke tests are fast enough that we should consider running the optimized tests on OS X. Thoughts? |
Thoughts: "a PR is the wrong place to have this discussion". :-) |
Arnold also ran a regular set of tests. Those don't do optimized either. |
@jrose-apple Sure. I was more just putting it out there before I send out an email |
:( I think the thread sanitizer inserts uses of the swifterror value. I will have to fix that. |
Upstream patch in the works ... |
llvm/stable picked up the fix. Should be fixed as soon as the failing bot picks up the fix. |
// last parameter that fits into a register as swiftself. | ||
// We should get this optimization back using the @convention(closure) whose | ||
// box argument should just be swift self. | ||
if (false && |
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.
This is resulting in a build warning about unreachable code.
Can you (ideally) remove this code and open a bug to restore the behavior that you'd like to eventually see, or alternately follows he advice in the note we emit (to add parens around false to silence the warning).
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.
Switch over to using the swift calling convention for swift functions
Use the generic type lowering algorithm described in
"docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion
type to the type expected by the Swift ABI.
Change IRGen to use the swift calling convention (swiftcc) for native swift
functions.
Use the 'swiftself' attribute on self parameters and for closures contexts.
Use the 'swifterror' parameter for swift error parameters.
Change functions in the runtime that are called as native swift functions to use
the swift calling convention.
rdar://problem/19979055