-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Remove apparently obsolete builtin functions #20947
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
Example of one of the currently failing tests:
|
Patch LGTM. You should just remove tests like that; they're specifically designed to test the SIL optimizer code that you've removed. I think you can just be aggressive about cutting the parts of tests that involve these builtins — we'll tell you if it looks like something you cut is actually redeemable, but the chances aren't high. |
- Remove s_to_u_checked_conversion and u_to_s_checked_conversion functions from builtin AST parsing, SIL/IR generation and from SIL optimisations.
- Remove unit tests for SIL transformations relating to s_to_u_checked_conversion and u_to_s_checked_conversion builtin functions.
OK, @rjmccall, sounds good. I've removed the unit tests. In my (limited) understanding of SIL Optimisations, they were all around transforms involving checked_conversion operators, combined with zext and trunc, when the expression you're working with has a known positive sign so the net result can safely be transformed to a no-op. I'm guessing this transform and these unit tests were relevant when the standard library used these operators within the implementation of some of the initialisers of the various Int types, now that's no longer the case (as I understand it)? |
p.s. can someone kick off full validation tests on this, to make sure there's no regression please? |
@swift-ci please test |
Build failed |
Build failed |
Build status slightly confusing, but the later tests seemed to pass? Looks good to merge if you guys want to? |
Yes, that’s a test pass. |
This reverts commit b914464, which passed the public CI bots, but broke some tests on watchOS.
* Remove apparently obsolete builtin functions. - Remove s_to_u_checked_conversion and u_to_s_checked_conversion functions from builtin AST parsing, SIL/IR generation and from SIL optimisations. * Remove apparently obsolete builtin functions - unit tests. - Remove unit tests for SIL transformations relating to s_to_u_checked_conversion and u_to_s_checked_conversion builtin functions.
(un-revert) Remove apparently obsolete builtin functions (#20947)
Remove s_to_u_checked_conversion and u_to_s_checked_conversion functions from builtin AST parsing and generation and from SIL optimisations.
This is a quick trial PR to attempt removing what seems to be a no longer used Builtin function and to see what happens.
This arises from discussions in the Swift compiler forums:
https://forums.swift.org/t/is-this-builtin-function-now-obsolete/18244/16
As discussed ran test suite (including iOS tests). No unexpected failures occurred. However two files produce failing unit tests on SIL optimisations because they're trying to optimise SIL containing these functions so they (of course) fail. Open to suggestions as to the best way to replace/remove/update these tests? Or if they constitute a deal breaker?
test/SILOptimizer/peephole_trunc_and_ext.sil
test/SILOptimizer/sil_combine.sil
@rjmccall @jckarter @stephentyrone
p.s. There's no point running a smoke test until we agree a unit test fix, I think it will surely fail.