Skip to content

stdlib: Sprinkle an __always inline onto Range.index(after:) #60560

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

aschwaighofer
Copy link
Contributor

After moving to the new llvm pass pipeline this function no longer gets
inlined. Leading to 150% regressions in ObjectiveCBridge benchmarks.

rdar://98533158

After moving to the new llvm pass pipeline this function no longer gets
inlined. Leading to 150% regressions in ObjectiveCBridge benchmarks.

rdar://98533158
@aschwaighofer
Copy link
Contributor Author

@swift-ci benchmark

@aschwaighofer
Copy link
Contributor Author

From the benchmark run:

IMPROVEMENT                                        OLD    NEW    DELTA    RATIO    
Breadcrumbs.IdxToUTF16Range.longMixed              2794   401    -85.6%   **6.97x**
Breadcrumbs.IdxToUTF16.longMixed                   4761   733    -84.6%   **6.50x**
ObjectiveCBridgeStringIsEqualAllSwift              130    52     -60.0%   **2.50x**
ObjectiveCBridgeStringIsEqual                      368    148    -59.8%   **2.49x**
ObjectiveCBridgeStringIsEqual2                     405    169    -58.3%   **2.40x**
ObjectiveCBridgeStringGetASCIIContents             591    261    -55.8%   **2.26x**
ObjectiveCBridgeStringHash                         155    69     -55.5%   **2.25x**
ObjectiveCBridgeStringCStringUsingEncoding         899    477    -46.9%   **1.88x**
ObjectiveCBridgeStringRangeOfString                1124   630    -44.0%   **1.78x**
NSStringConversion.MutableCopy.Rebridge.LongUTF8   601    355    -40.9%   **1.69x**
BridgeString.find.native.nonASCII                  463    303    -34.6%   **1.53x**
ObjectiveCBridgeStringCompare2                     925    610    -34.1%   **1.52x**
ObjectiveCBridgeStringCompare                      951    633    -33.4%   **1.50x**
NSStringConversion.MutableCopy.LongUTF8            489    372    -23.9%   **1.31x**

@aschwaighofer
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@Catfish-Man Catfish-Man left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you!

@aschwaighofer aschwaighofer merged commit e5a35f9 into swiftlang:main Aug 16, 2022
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