Skip to content

Fix Interpreter/dynamic_self.swift test for ExistentialSpecializer #24411

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
May 5, 2019

Conversation

rajbarik
Copy link
Contributor

@rajbarik rajbarik commented May 1, 2019

No description provided.

@rajbarik rajbarik requested a review from atrick May 1, 2019 19:53
@rajbarik
Copy link
Contributor Author

rajbarik commented May 1, 2019

@swift-ci test.

@rajbarik
Copy link
Contributor Author

rajbarik commented May 1, 2019

@swift-ci test linux

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

I think you should comment why the attribute is necessary, at least in the commit message but preferably in test itself--the optimizer may specialize the call and attempt to inline, but inlining that would defeat the purpose of the test which is intended to exercise IRGen on these function bodies. Inlining may also cause self to be destroyed before the print statement executes.

@slavapestov
Copy link
Contributor

@rajbarik Does the behavior of the test change without the @inline(never)? If so it's a bug in the specializer.

@slavapestov
Copy link
Contributor

@atrick I don't understand what you're suggesting here. Optimizations should never change the behavior of any code. The test is run with both optimizations off and on (check-swift-validation and check-swift-validation-optimize) and the latter has caught optimizer bugs before.

@slavapestov
Copy link
Contributor

Oh I see. How about we just remove the print statements from the deinits.

@atrick
Copy link
Contributor

atrick commented May 2, 2019

@slavapestov I think it's a problem in general when IRGen unit tests are written in .swift. I agree it's best not to change the RUN line. So the question is whether you still want the test to be useful at -O. My point is that if the test is actually useful, then those print statements will be in the correct order. It seems strange to me to write passing CHECKs for a test that's already broken. But I don't have a strong opinion.

@slavapestov
Copy link
Contributor

@atrick The part of the test that tests when the deinit occurs is not very useful. We should remove it. The rest is still useful. It's mostly an execution test for code generated by IRGen, but it has randomly turned up optimizer crashes in the past, mostly because our coverage of DyamicSelfType elsewhere in the optimizer wasn't great.

@atrick
Copy link
Contributor

atrick commented May 2, 2019

@slavapestov sounds fine to me. I was just guessing at the purpose of the test, and couldn't help but notice that IRGen will never even see a dynamicself in the -O build.

@rajbarik I guess you can just remove the print statements in the deinitializers, then you don't need the @inline(never).

@rajbarik rajbarik force-pushed the raj-fix-test branch 2 times, most recently from 77f476f to 4a23442 Compare May 2, 2019 05:22
@rajbarik
Copy link
Contributor Author

rajbarik commented May 2, 2019

@swift-ci test.

@rajbarik
Copy link
Contributor Author

rajbarik commented May 2, 2019

@swift-ci test linux

@swift-ci
Copy link
Contributor

swift-ci commented May 2, 2019

Build failed
Swift Test Linux Platform
Git Sha - 1304a0a97e2874cd746aa390b2d5f8c5c923ee5e

@rajbarik
Copy link
Contributor Author

rajbarik commented May 4, 2019

@swift-ci test.

@swift-ci
Copy link
Contributor

swift-ci commented May 4, 2019

Build failed
Swift Test Linux Platform
Git Sha - 4a2344213849f9deca888607f341161cf208fdf5

@swift-ci
Copy link
Contributor

swift-ci commented May 4, 2019

Build failed
Swift Test OS X Platform
Git Sha - 1304a0a97e2874cd746aa390b2d5f8c5c923ee5e

@rajbarik rajbarik merged commit 4e719ed into swiftlang:master May 5, 2019
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