-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SILCombine: optimize creating enums with tuple payloads. #30508
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
Convert sequences of %payload_addr = init_enum_data_addr %enum_addr %elem0_addr = tuple_element_addr %payload_addr, 0 %elem1_addr = tuple_element_addr %payload_addr, 1 ... store %payload0 to %elem0_addr store %payload1 to %elem1_addr ... inject_enum_addr %enum_addr, $EnumType.case to %tuple = tuple (%payload0, %payload1, ...) %enum = enum $EnumType, $EnumType.case, %tuple store %enum to %enum_addr Such patterns are generated for example when using the stdlib enumarated() function. Part of rdar://problem/33438123
@swift-ci test |
@swift-ci benchmark |
Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
Performance: -Onone
Code 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
|
This looks like it’s just undoing the SILGen lowering of address only types that become loadable after specialization. We really ought to be finishing opaque values... |
Hi @eeckstein – This breaks on my Fedora 31 Linux box (x86_64). Can we revert this? Or fix it quickly?
|
A fix is on the way: #30526 |
@martinboehme Can we please wait until my fix (#30526) gets merged? Hopefully the linux smoke test now passes, then it should be merged soon. |
Sure. I'd just like to make sure that my #30233 gets reverted either way, so that the breakage caused by it is fixed. Once your #30526 is merged, #30528 (the revert of #30233 plus your change) can no longer be merged. I'm about to end my working day -- if you're still around for a bit, can you help make sure that my #30233 gets reverted? |
I merged #30526 to honor @eeckstein's original "test and merge" CI request and because I verified the fix locally. |
Thanks everyone! I'm going to take care of reverting #30233. |
I'll shepherd #30531. |
Sorry for the noise and also from my side: thanks everyone! |
@eeckstein – What if any insight can you give about how this pull request passed CI before merging? Thanks! |
Some SIL parsing change came in between my tests run and I merged the PR. |
Though I don't know which change it was specifically. |
I should have rebased and re-tested before the merge |
I wouldn't feel bad, Swift CI in general doesn't try to solve this classic race condition between pull requests: |
The SIL parser change was #30499. |
Convert sequences of
to
Such patterns are generated for example when using the stdlib enumarated() function.
Part of rdar://problem/33438123