Skip to content

[semantic-arc-opts] Teach semantic-arc-opts how to handle structs with multiple non-trivial values. #32173

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 Jun 4, 2020

Just like br inst, structs are phis in the ownership graph that one can induce
on top of the def-use graph. In this commit, I basically fill in the relevant
blanks in the ADT for such phis for struct so that the optimization for branches
is generalized onto structs.

rdar://problem/63950481


NOTE: The first commit is from #32172. I am using the original implementation to check the correctness of the refactor before I land this.

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 4, 2020

@swift-ci test

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 4, 2020

@swift-ci test source compatibility

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 4, 2020

@swift-ci benchmark

@swift-ci
Copy link
Contributor

swift-ci commented Jun 4, 2020

Build failed
Swift Test OS X Platform
Git Sha - dc40712199621764c50cb2d42fa8a7334db5a2f2

@swift-ci
Copy link
Contributor

swift-ci commented Jun 4, 2020

Performance: -O

Improvement OLD NEW DELTA RATIO
FlattenListFlatMap 5965 4396 -26.3% 1.36x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
FlattenListLoop 3872 4271 +10.3% 0.91x (?)
FlattenListFlatMap 5845 6421 +9.9% 0.91x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStubNSDateRefAccess 4514 4930 +9.2% 0.92x (?)

Code size: -swiftlibs

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 Pro
  Model Identifier: MacPro6,1
  Processor Name: 8-Core Intel Xeon E5
  Processor Speed: 3 GHz
  Number of Processors: 1
  Total Number of Cores: 8
  L2 Cache (per Core): 256 KB
  L3 Cache: 25 MB
  Memory: 64 GB

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 4, 2020

@swift-ci test OS X platform

…h multiple non-trivial values.

Just like br inst, structs are phis in the ownership graph that one can induce
on top of the def-use graph. In this commit, I basically fill in the relevant
blanks in the ADT for such phis for struct so that the optimization for branches
is generalized onto structs.

<rdar://problem/63950481>
@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 4, 2020

The Debug failure wasn't my patch:

CompileSwift normal arm64 /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Fruit.swift (in target 'Backend' from project 'Backend')
    cd /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend
    /Users/buildnode/jenkins/workspace-private/swift-PR-source-compat-suite-debug/build/compat_macos/install/toolchain/usr/bin/swift -frontend -c /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/environments/Items.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/environments/SubscriptionManager.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/environments/UserCollection.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/extensions/Array.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/extensions/Collection.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/APIError.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Category.swift -primary-file /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Fruit.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Hemisphere.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Infrastucture.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Island.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Item.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Listing.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Material.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/MysteryIsland.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Turnips.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/UserList.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Variant.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/Villager.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/models/VillagerHourse.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/services/ACNHApiService.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/services/ImageService.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/services/LocalizedItemsService.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/services/NookPlazaAPIService.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/services/NookazonService.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/services/NotificationsManager.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/services/TurnipExchangeService.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/services/TurnipPredictionsService.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/utils/AppUserDefault.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/utils/URL.swift /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/wrappers/UserDefaultWrapper.swift -emit-module-path /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/Objects-normal/arm64/Fruit\~partial.swiftmodule -emit-module-doc-path /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/Objects-normal/arm64/Fruit\~partial.swiftdoc -emit-module-source-info-path /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/Objects-normal/arm64/Fruit\~partial.swiftsourceinfo -serialize-diagnostics-path /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/Objects-normal/arm64/Fruit.dia -emit-dependencies-path /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/Objects-normal/arm64/Fruit.d -emit-reference-dependencies-path /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/Objects-normal/arm64/Fruit.swiftdeps -target arm64-apple-ios13.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk -I /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Debug-iphoneos -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib -F /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Debug-iphoneos -F /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -enable-testing -g -swift-version 5 -enforce-exclusivity=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D Xcode -serialize-debugging-options -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=/Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/GeneratedModuleMaps/iphoneos/SDWebImage.modulemap -Xcc -fmodule-map-file=/Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/GeneratedModuleMaps/iphoneos/Purchases.modulemap -Xcc -I/Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/swift-overrides.hmap -Xcc -I/Users/buildnode/Library/Developer/Xcode/DerivedData/ACHNBrowserUI-hfjdrjngutjrbsdqoevznnvbgclk/SourcePackages/checkouts/SDWebImage/SDWebImage/include -Xcc -I/Users/buildnode/Library/Developer/Xcode/DerivedData/ACHNBrowserUI-hfjdrjngutjrbsdqoevznnvbgclk/SourcePackages/checkouts/purchases-ios/Purchases/Public -Xcc -I/Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Debug-iphoneos/include -Xcc -I/Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/DerivedSources-normal/arm64 -Xcc -I/Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/DerivedSources/arm64 -Xcc -I/Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG=1 -Xcc -working-directory/Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend -target-sdk-version 13.4 -module-name Backend -o /Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/build/Backend.build/Debug-iphoneos/Backend.build/Objects-normal/arm64/Fruit.o
/Users/buildnode/jenkins/workspace/swift-PR-source-compat-suite-debug/swift-source-compat-suite/project_cache/ACHNBrowserUI/ACHNBrowserUI/ACHNBrowserUI/packages/Backend/Sources/Backend/services/ImageService.swift:10:8: error: could not find module 'UIImageColors' for target 'arm64-apple-ios'; found: armv7-apple-ios, arm, armv7
import UIImageColors

@gottesmm gottesmm force-pushed the pr-5e5960b7d932ff90a03c93f1ba6ac111c52d1157 branch from dc40712 to 3cb33ac Compare June 4, 2020 08:08
@gottesmm gottesmm requested a review from atrick June 4, 2020 08:08
@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 4, 2020

Just did a rebase.

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 4, 2020

@swift-ci smoke test

3 similar comments
@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 4, 2020

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 4, 2020

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

gottesmm commented Jun 4, 2020

@swift-ci smoke test

@gottesmm gottesmm merged commit d3e64ed into swiftlang:master Jun 4, 2020
@gottesmm gottesmm deleted the pr-5e5960b7d932ff90a03c93f1ba6ac111c52d1157 branch June 5, 2020 20:27
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