Skip to content

[SIL] Add source formal type to checked_cast_br. #67583

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

Merged

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented Jul 27, 2023

It is necessary for opaque values for casts that will newly start out as checked_cast_brs and be lowered to checked_cast_addr_brs, since the latter has the source formal type, IRGen relies on being able to access it, and there's no way in general to obtain the source formal type from the source lowered type.

It is necessary for opaque values where for casts that will newly start
out as checked_cast_brs and be lowered to checked_cast_addr_brs, since
the latter has the source formal type, IRGen relies on being able to
access it, and there's no way in general to obtain the source formal
type from the source lowered type.
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test source compatibility

@nate-chandler nate-chandler requested review from atrick and meg-gupta and removed request for hamishknight July 28, 2023 00:18
@nate-chandler
Copy link
Contributor Author

@swift-ci please benchmark

@nate-chandler
Copy link
Contributor Author

@swift-ci Please Apple Silicon benchmark

@nate-chandler
Copy link
Contributor Author

------- Performance (x86_64): -O -------

REGRESSION                               OLD       NEW      DELTA    RATIO
Breadcrumbs.IdxToUTF16Range.longMixed    356.667   395.0    +10.7%   **0.90x (?)**
Breadcrumbs.IdxToUTF16.longMixed         1092.0    1202.0   +10.1%   **0.91x (?)**

IMPROVEMENT                              OLD       NEW      DELTA    RATIO
Array.removeAll.keepingCapacity.Object   6.832     5.148    -24.6%   **1.33x (?)**
FlattenListFlatMap                       4134.0    3801.0   -8.1%    **1.09x (?)**
FlattenListLoop                          1486.0    1386.0   -6.7%    **1.07x (?)**

------- Code size: -O -------

------- Performance (x86_64): -Osize -------

REGRESSION                              OLD        NEW        DELTA    RATIO
StringDistance.utf16.mixed              102.826    115.667    +12.5%   **0.89x (?)**
Breadcrumbs.IdxToUTF16Range.longMixed   357.333    394.333    +10.4%   **0.91x (?)**
Breadcrumbs.IdxToUTF16.longMixed        1091.0     1198.0     +9.8%    **0.91x (?)**

IMPROVEMENT                             OLD        NEW        DELTA    RATIO
CharIteration_japanese_unicodeScalars   6300.0     5818.182   -7.6%    **1.08x (?)**
CharIteration_chinese_unicodeScalars    3901.176   3635.294   -6.8%    **1.07x (?)**
DataAppendArray                         3081.132   2879.245   -6.6%    **1.07x (?)**

------- Code size: -Osize -------

------- Performance (x86_64): -Onone -------

REGRESSION                    OLD        NEW        DELTA    RATIO
SubstringRemoveFirst1         0.143      0.2        +39.6%   **0.72x (?)**
CharacterLiteralsLarge        393.6      448.8      +14.0%   **0.88x (?)**

IMPROVEMENT                   OLD        NEW        DELTA    RATIO
ArrayAppendGenericStructs     1786.667   1190.0     -33.4%   **1.50x (?)**
DataAppendDataSmallToMedium   3163.636   2956.667   -6.5%    **1.07x (?)**

------- Code size: -swiftlibs -------
------- Performance (arm64): -O -------

REGRESSION                         OLD       NEW       DELTA    RATIO
KeyPathWritePerformance            19.938    25.778    +29.3%   **0.77x**
Data.init.Sequence.64kB.Count.RE   1.771     1.971     +11.3%   **0.90x (?)**

IMPROVEMENT                        OLD       NEW       DELTA    RATIO
NaiveRRC.append.largeContiguous    0.082     0.0       -98.8%   **83.00x (?)**
StringWithCString2                 0.001     0.0       -50.0%   **2.00x (?)**
CharacterPropertiesStashed         468.286   412.5     -11.9%   **1.14x (?)**
ObserverForwarderStruct            200.385   182.727   -8.8%    **1.10x (?)**

------- Code size: -O -------

------- Performance (arm64): -Osize -------

REGRESSION                                        OLD        NEW        DELTA    RATIO
KeyPathWritePerformance                           23.444     29.286     +24.9%   **0.80x (?)**

IMPROVEMENT                                       OLD        NEW        DELTA    RATIO
StringWithCString2                                0.001      0.0        -50.0%   **2.00x (?)**
CharIteration_japanese_unicodeScalars             4485.333   3653.333   -18.5%   **1.23x**
CharIteration_punctuatedJapanese_unicodeScalars   741.935    617.436    -16.8%   **1.20x**
CharIteration_chinese_unicodeScalars              2734.545   2293.913   -16.1%   **1.19x**
CharIteration_korean_unicodeScalars               3718.095   3202.0     -13.9%   **1.16x**
DataAppendDataSmallToMedium                       2088.75    1948.0     -6.7%    **1.07x (?)**

------- Code size: -Osize -------

------- Performance (arm64): -Onone -------

REGRESSION                 OLD       NEW       DELTA    RATIO
KeyPathWritePerformance    32.03     37.828    +18.1%   **0.85x (?)**

IMPROVEMENT                OLD       NEW       DELTA    RATIO
RawBuffer.1000.findFirst   58672.0   52436.0   -10.6%   **1.12x**
Set.filter.Int100.24k      69.714    62.575    -10.2%   **1.11x**
Set.filter.Int100.20k      58.475    52.591    -10.1%   **1.11x**
Set.filter.Int100.16k      47.24     42.593    -9.8%    **1.11x**
Set.filter.Int100.28k      83.067    75.031    -9.7%    **1.11x**
RawBuffer.39.findFirst     2966.0    2735.0    -7.8%    **1.08x (?)**

------- Code size: -swiftlibs -------

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My review was cursory, but it looks great! Thanks for updating a million tests.

@nate-chandler nate-chandler merged commit 5116600 into swiftlang:main Jul 28, 2023
@nate-chandler nate-chandler deleted the checked_cast_br/formal-source branch July 28, 2023 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants