-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SIL] NFC: Shrink SILGlobalVariable by 16 bytes #32135
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
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.
lgtm
Thanks @eeckstein – I was concerned because it looks like |
Is |
Hi @gribozavr – Ya, that's my concern as well and the lack of a pointer specialization was hint that |
I share @gribozavr's concern. Maybe we can just not use |
That was my first choice, but got shy of that approach because it required making |
We could maybe expose it as a |
Yeah, I like that plan better than exposing a default constructor. |
@swift-ci please test |
Build failed |
Build failed |
Oops. I had to force push an update. I realized after the fact that @swift-ci please test |
Build failed |
Build failed |
Ping. Now that this has been simplified to the suggested |
@davezarzycki IDK who might know the answer, but since I can't easily find such specializations in LLVM codebase, I think it is safe to say it is not supported. If you are up for a templates programming adventure, you could refactor |
Ya, a "extra inhabitants" trait (like Swift's internal logic for Swift code) would make I'm still looking for a LGTM sign off when somebody has the time. In particular, the const'ifying of the SILLocation given that nothing is updating the location after the SILGlobalVariable is created. |
This PR looks good to me, but unfortunately I'm not familiar with this code sufficiently to be comfortable actually approving -- sorry! |
Ping @jckarter, @eeckstein. Might I get a LGTM review? |
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.
LGTM
There are two changes here. One is simply moving a boolean. The other involves a specialization of
llvm::Optional
forSILLocation
. This seems to tantalizingly close. When optimizations are enabled, only two tests fail but without optimizations, the Glibc swift module fails to build. Before I debug this further, is this a good idea? This technically collapses a level of optionality.