-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
recognize assigning .init of all zeros, replace with memset #10967
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#10967" |
426f24f to
f508a38
Compare
| if ((sle.useStaticInit || | ||
| sle.elements && allZeroBits(*sle.elements) && !sle.sd.isNested()) && | ||
| ae.e2.type.isZeroInit(ae.e2.loc)) |
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.
Should this be
(sle.useStaticInit && ae.e2.type.isZeroInit(ae.e2.loc))
||
(sle.elements && allZeroBits(*sle.elements) && !sle.sd.isNested())?
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.
no because sle.elements does not include default initializers.
2907d00 to
02962c5
Compare
So I click for "Details", and there are no details, no log, just it failed. |
|
Does this include init with void gaps ?, e.g because in this case the gap can be ignored and filled with 0 as well. |
|
Looks like the C++ heisenbug disappeared. |
|
@atilaneves wunderbar! |
Structs are often initialized or assigned values of all 0 bits. This usually results in copying the
.initglobal into the struct. This PR recognizes some of those cases and replaces them withmemset'ing them to zero. This is faster, and a step towards eliminating the.initglobal altogether.