Skip to content

[NFC][AutoDiff] Pass AutoDiffConfig by const ref. #37074

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
merged 1 commit into from
Apr 27, 2021

Conversation

integralpro
Copy link
Contributor

AutoDiffConfig is a trivial structure but its size is greater than two registers. It makes an object most likely to be placed on a stack while passing it by value. Here is a small example: https://godbolt.org/z/onMbz1vnW

The change is NFC, making all functions that expect AutoDiffConfig as an argument to be passes by constant reference.

@integralpro
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b126619

@integralpro
Copy link
Contributor Author

@swift-ci Please smoke test linux

@integralpro
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b126619

@integralpro
Copy link
Contributor Author

@swift-ci Please test linux

@integralpro
Copy link
Contributor Author

@swift-ci Please smoke test linux

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b126619

@integralpro
Copy link
Contributor Author

@swift-ci Please clean test linux

@integralpro integralpro marked this pull request as ready for review April 27, 2021 20:30
@integralpro integralpro merged commit f8baffa into swiftlang:main Apr 27, 2021
@integralpro integralpro deleted the ConstAutoDiffConfigRef branch April 27, 2021 20:40
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.

4 participants