Skip to content

Translate sil-opt bridge cast folding test into an Interpreter test. #23107

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

This will run with the ownership verifier and will improve our test coverage of
the cast optimizer.

@gottesmm gottesmm force-pushed the pr-493b7454e86937a06ec62956e663d9c7f149fbea branch from d71aadb to 9b5d8da Compare March 5, 2019 20:00
@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 5, 2019

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 5, 2019

I renamed the file and forgot to rename the filecheck pattern.

@gottesmm gottesmm force-pushed the pr-493b7454e86937a06ec62956e663d9c7f149fbea branch from 9b5d8da to db33d9c Compare March 5, 2019 22:41
@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 5, 2019

@swift-ci smoke test and merge

3 similar comments
@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 5, 2019

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 5, 2019

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 5, 2019

@swift-ci smoke test and merge

@gottesmm gottesmm force-pushed the pr-493b7454e86937a06ec62956e663d9c7f149fbea branch from db33d9c to 98ef349 Compare March 6, 2019 05:10
@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 6, 2019

Ok. This is it for real.

@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 6, 2019

@swift-ci smoke test and merge

2 similar comments
@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 6, 2019

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 6, 2019

@swift-ci smoke test and merge

This will run with the ownership verifier and will improve our test coverage of
the cast optimizer.
@gottesmm gottesmm force-pushed the pr-493b7454e86937a06ec62956e663d9c7f149fbea branch from 98ef349 to f5a6032 Compare March 6, 2019 05:11
@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 6, 2019

@swift-ci smoke test and merge

3 similar comments
@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 6, 2019

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 6, 2019

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 6, 2019

@swift-ci smoke test and merge

// error here like in the other crashes.
//
// CHECK-LABEL: [ RUN ] BridgedCastFolding.NSDictionary -> Swift (Dictionary). Crashing Test Cases
// CHECK: stderr>>> OK: saw expected "crashed: sigill"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ravikandhadai This is a cast where I think we could give a better error message. (Really we should see if we can de-obfuscate these types at runtime. If we know we are going to crash, we should see if we can do a better job with this since runtime isn't an issue. Might be interesting for you guys).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, let me be more clear. I was commenting on two things here:

  1. I think we are optimizing this at -Onone when we should not be, not because we can't, but because we want to leave in the error messages. Today the cast optimizer always tries to optimize these at -Onone via constant propagation. This I think violates the stronger notion of as-if at -Onone. It might be interesting for you to look at.
  2. In general the runtime error messages that I found here have internal runtime names. I wonder if it would make sense to use for instance __NSCFString to just say NSString.

Copy link
Contributor Author

@gottesmm gottesmm Mar 6, 2019

Choose a reason for hiding this comment

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

@ravikandhadai (I might fix 1 if I have time).

Copy link
Contributor

Choose a reason for hiding this comment

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

@gottesmm I am not very familiar with this aspect of constant propagation. Just to get more clarity on the problem, isforcedCast(nsDictString) being optimized by ConstantPropagation? It is not transparent, so I am bit confused here.

Copy link
Member

Choose a reason for hiding this comment

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

The missing message turned out to be caused by an issue in the Foundation overlay (fixed in #23174).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the update.

@gottesmm
Copy link
Contributor Author

gottesmm commented Mar 6, 2019

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 56c8105 into swiftlang:master Mar 6, 2019
@gottesmm gottesmm deleted the pr-493b7454e86937a06ec62956e663d9c7f149fbea branch March 6, 2019 06:21
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