Skip to content

Ignore onFastPath builtin while looking for valid static initializer of a global variable #32319

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

Conversation

meg-gupta
Copy link
Contributor

The presence of this builtin has no effect while optimizing initializers of global variables.

@meg-gupta meg-gupta requested a review from eeckstein June 11, 2020 17:22
@meg-gupta
Copy link
Contributor Author

@swift-ci smoke test

@meg-gupta
Copy link
Contributor Author

@swift-ci smoke test OS X

@meg-gupta
Copy link
Contributor Author

@swift-ci Please smoke test OS X platform

@meg-gupta
Copy link
Contributor Author

@swift-ci Please smoke test Linux platform

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

You need to handle this builtin also in IRGen's emitConstantValue().
It would make sense to add a run command line with -emit-ir to test/SILOptimizer/optionset.swift, so that this is also tested.

@meg-gupta
Copy link
Contributor Author

@eeckstein I can't seem to write a test where the builtin needs to be handled in IRGen's emitConstantValue. Looks like onFastPath builtin is generated with no users during SILGen, so the static initializer will not have the onFastPath builtin. Additionally, we never seem to call emitConstantValue for an empty type.

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

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

@meg-gupta okay, thanks for checking. If it compiles, then it's fine.

@meg-gupta meg-gupta merged commit 4d705ab into swiftlang:master Jun 15, 2020
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