Skip to content

[ownership] Change guaranteed args from transformation terminators to not require end_borrows. #29600

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

gottesmm
Copy link
Contributor

@gottesmm gottesmm commented Feb 2, 2020

No description provided.

@gottesmm gottesmm force-pushed the pr-d1b175b6bba114b57173be25ad701464ec91e4b9 branch from 22b4f99 to 917dd4d Compare February 2, 2020 22:20
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 2, 2020

Lets see what source compat says.

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 2, 2020

@swift-ci test source compatibility

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 2, 2020

@swift-ci test linux platform

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 2, 2020

Hmm... error already came up when building stdlib in release locally. These are going to fail.

@gottesmm gottesmm force-pushed the pr-d1b175b6bba114b57173be25ad701464ec91e4b9 branch from 917dd4d to 7b26a62 Compare February 2, 2020 22:30
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 2, 2020

@swift-ci test source compatibility

3 similar comments
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 2, 2020

@swift-ci test source compatibility

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 2, 2020

@swift-ci test source compatibility

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 2, 2020

@swift-ci test source compatibility

@swift-ci
Copy link
Contributor

swift-ci commented Feb 2, 2020

Build failed
Swift Test Linux Platform
Git Sha - 917dd4dafdaa373f53b5ed9c604eaab1b113582b

… not require end_borrows.

For those who are unaware, a transformation terminator is a terminator like
switch_enum/checked_cast_br that always dominate their successor blocks. Since
they dominate their successor blocks by design and transform their input into
the args form, we can validate that they obey guaranteed ownership semantics
just like a forwarding instruction.

Beyond removing unnecessary code bloat, this also makes it significantly more
easier to optimize/work with transformation terminators when converting @owned
-> @guaranteed since we do not need to find end_borrow points when the owned
value is consumed.

<rdar://problem/59097063>
@gottesmm gottesmm force-pushed the pr-d1b175b6bba114b57173be25ad701464ec91e4b9 branch from 7b26a62 to 6c5c853 Compare February 3, 2020 01:05
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test

1 similar comment
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@gottesmm gottesmm changed the title [DRAFT][ownership] Change guaranteed args from transformation terminators to not require end_borrows. [ownership] Change guaranteed args from transformation terminators to not require end_borrows. Feb 3, 2020
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test source compatibility

1 similar comment
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test source compatibility

@gottesmm gottesmm requested a review from atrick February 3, 2020 01:06
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test source compatibility

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test windows platform

2 similar comments
@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test windows platform

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test windows platform

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2020

Performance: -O

Regression OLD NEW DELTA RATIO
FlattenListFlatMap 5310 5735 +8.0% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 250 142 -43.2% 1.76x
PrefixAnySeqCntRangeLazy 18 14 -22.2% 1.29x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
DataSetCountSmall 80 87 +8.7% 0.92x
 
Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 222 100 -55.0% 2.22x
DataAccessBytesMedium 56 50 -10.7% 1.12x (?)
Data.init.Sequence.64kB.Count.RE.I 55 50 -9.1% 1.10x (?)
Data.append.Sequence.64kB.Count.RE.I 33 30 -9.1% 1.10x (?)
Data.init.Sequence.809B.Count.RE 103 95 -7.8% 1.08x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
DataAppendDataSmallToSmall 2880 3280 +13.9% 0.88x (?)
 
Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 294 162 -44.9% 1.81x
DataCopyBytesSmall 130 115 -11.5% 1.13x

Code size: -swiftlibs

Improvement OLD NEW DELTA RATIO
libswiftStdlibUnittest.dylib 335872 327680 -2.4% 1.02x
How to read the data The 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
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac mini
  Model Identifier: Macmini8,1
  Processor Name: Intel Core i7
  Processor Speed: 3.2 GHz
  Number of Processors: 1
  Total Number of Cores: 6
  L2 Cache (per Core): 256 KB
  L3 Cache: 12 MB
  Memory: 64 GB

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci test windows platform

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

Hmmm... I have no clue why that benchmark improved so much.

@gottesmm
Copy link
Contributor Author

gottesmm commented Feb 3, 2020

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2020

Performance: -O

Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 250 142 -43.2% 1.76x
PolymorphicCalls 15 14 -6.7% 1.07x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
DataSetCountSmall 80 87 +8.7% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 222 100 -55.0% 2.22x
Data.init.Sequence.64kB.Count.RE.I 56 50 -10.7% 1.12x (?)
Data.append.Sequence.64kB.Count.RE.I 33 30 -9.1% 1.10x (?)
DataAccessBytesMedium 54 50 -7.4% 1.08x (?)
Data.init.Sequence.64kB.Count.RE 54 50 -7.4% 1.08x (?)

Code size: -Osize

Performance: -Onone

Improvement OLD NEW DELTA RATIO
DataCopyBytesMedium 284 162 -43.0% 1.75x
DataCopyBytesSmall 130 115 -11.5% 1.13x (?)

Code size: -swiftlibs

Improvement OLD NEW DELTA RATIO
libswiftStdlibUnittest.dylib 335872 327680 -2.4% 1.02x
How to read the data The 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
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac mini
  Model Identifier: Macmini8,1
  Processor Name: Intel Core i7
  Processor Speed: 3.2 GHz
  Number of Processors: 1
  Total Number of Cores: 6
  L2 Cache (per Core): 256 KB
  L3 Cache: 12 MB
  Memory: 64 GB

@gottesmm gottesmm merged commit 643227e into swiftlang:master Feb 3, 2020
@gottesmm gottesmm deleted the pr-d1b175b6bba114b57173be25ad701464ec91e4b9 branch February 3, 2020 07:39
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