-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Eliminate the last direct use of Builtin.UnknownObject #11984
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
At the Swift level, this is equivalent to AnyObject, which we've done much more testing of. This commit paves the way for taking UnknownObject out of the SIL type system and just using it as type metadata. Filed https://bugs.swift.org/browse/SR-5926 to track that work.
@swift-ci Please test |
and just in case, though it would be astonishing for this not to compile down to the same thing… @swift-ci Please smoke benchmark |
Builtin.bridgeToRawPointer(Builtin.castToUnknownObject(l)), | ||
Builtin.bridgeToRawPointer(Builtin.castToUnknownObject(r)) | ||
)) | ||
return ObjectIdentifier(l) == ObjectIdentifier(r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eeckstein @atrick Is the casting sequence here necessary for the optimizer to recognize ===
operations?
Build comment file:Optimized (O)Regression (3)
Improvement (1)
No Changes (323)
Unoptimized (Onone)Improvement (3)
No Changes (324)
Hardware Overview
|
Interesting. We might be able to remove the type altogether, and just keep the TypeInfo in IRGen, used for lowering AnyObject and @objc class references. |
That's my SR-5926 hope! |
Still hoping for someone from @eeckstein's team to tell me whether this is okay, just in case. |
Since there are no regressions on the benchmarks, I think it's ok. |
I experimented with it. The new |
Thanks, both! |
At the Swift level, this is equivalent to AnyObject, which we've done much more testing of. This commit paves the way for taking UnknownObject out of the SIL type system and just using it as type metadata. Filed SR-5926 to track that work.