-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SR-8272] Drop the last remnants of LogicValue #21451
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 please smoke test |
@swift-ci please test source compatibility |
I don’t think this is an ABI change; you’re only removing a transparent function so it should have been inlined away. It’s up to you if you want to push for this to go into 5.0 or not, but my gut feeling is to be conservative and leave it on master. @Azoy weren’t you working on something similar recently? |
Removes the _getBuiltinLogicValue intrinsic in favor of an open-coded struct_extract in SIL. This removes Sema's last non-literal use of builtin integer types and unblocks a bunch of cleanup. This patch would be NFC, but it improves line information for conditional expression codegen.
Yeah I had something similar here: #21285, but this patch seems successful in removing this logic from Sema and into SILGen. |
While I don't think this affects ABI (because transparent), I think it is still a good candidate for the 5.0 branch because I don't think we really want users to be able to access this function as an API. let x = true._getBuiltinLogicValue() // ok The same could be said about the let x = true._getBuiltinLogicValue() // ok
let y = _getBool(x) // ok |
Source Compatibility passed (https://ci.swift.org/job/swift-PR-source-compat-suite/2331/ and https://ci.swift.org/job/swift-PR-source-compat-suite-debug/557/). Fixing the API digester tests. |
@swift-ci please smoke test |
LLDB's failing. Will try again in the morning. |
Technically transparent functions are only inlined away when called immediately, but this particular function is almost certainly never not called immediately. |
@swift-ci please smoke test |
Still want core team member sign-off on this and plans to push these to 5.0. |
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 a very nice improvement. I don't think it change the ABI in practical terms because of the @transparent
, but I would like to get it into 5.0 if we can. Let's get it merged to master and cherry-pick for 5.0.
⛵️ |
@CodaFi will you cherry-pick for the 5.0 branch? |
Cherry picking as I type. |
@DougGregor slightly off topic for this pr, but because this is making it in the 5.0 branch, could the removal of the |
Removes the _getBuiltinLogicValue intrinsic in favor of an open-coded struct_extract in SIL. This removes Sema's last non-literal use of builtin integer types and unblocks a bunch of cleanup.
This patch would be NFC, but it improves line information for conditional expression codegen.
Resolves SR-8272.
Since this seems to have hit the trifecta of ABI change, compiler change, and stdlib change: lots of reviews please. This oughta go into 5.0 as well.