Skip to content

[DeadFunctionElimination] Pass on keypaths to foreign DeclRef properties #12625

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

graydon
Copy link
Contributor

@graydon graydon commented Oct 26, 2017

These show up specifically when someone forms a keypath to an ObjC
property in a category. They're no-ops from the perspective of
DFE but the code has to intentionally skip the case if it wants to
avoid the subsequent llvm_unreachable (in an assertion build).

rdar://34913689

@graydon graydon requested a review from jckarter October 26, 2017 00:54
@graydon
Copy link
Contributor Author

graydon commented Oct 26, 2017

@swift-ci please test

@gottesmm
Copy link
Contributor

Can you add a sil test case for DFE?

@graydon
Copy link
Contributor Author

graydon commented Oct 26, 2017

@gottesmm I think I did? you'd prefer one added to dead_function_elimination.swift as well?

(Note the extra -O execution of the test there and the enclosing function being made-public: means DFE kicks in and asserts with failure if the fix isn't present)

@gottesmm
Copy link
Contributor

gottesmm commented Oct 26, 2017 via email

@graydon
Copy link
Contributor Author

graydon commented Oct 26, 2017

@gottesmm I added a secondary copy of the -emit-ir RUN line with -O turned on. It does run the optimizer as far as I know (it crashes with the motivating assert in DFE when I run the test but undo the fix).

Again, I can add another if this is insufficiently obvious, but I think it does test the thing it's trying to test.

…ies.

These show up specifically when someone forms a keypath to an ObjC
property in a category. They're no-ops from the perspective of
DFE but the code has to intentionally skip the case if it wants to
avoid the subsequent llvm_unreachable.

rdar://34913689
@graydon graydon force-pushed the rdar-34913689-dead-function-elim-vs-foreign-declref-keypaths branch from 94143b5 to 3ef686b Compare October 26, 2017 06:22
@graydon
Copy link
Contributor Author

graydon commented Oct 26, 2017

@gottesmm split test out into its own file in SILOptimizer.

@graydon
Copy link
Contributor Author

graydon commented Oct 26, 2017

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 94143b579f402873e676640afe2b013762e8ef71

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 94143b579f402873e676640afe2b013762e8ef71

Copy link
Contributor

@jckarter jckarter left a comment

Choose a reason for hiding this comment

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

Good catch, thanks Graydon!

@gottesmm
Copy link
Contributor

@graydon Thanks!

@graydon graydon merged commit cc5a356 into swiftlang:master Oct 26, 2017
@graydon graydon deleted the rdar-34913689-dead-function-elim-vs-foreign-declref-keypaths branch November 17, 2017 18:29
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