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
Fix Issue 18362 - Try to enable lto for all dmd builds #492
Conversation
Thanks for your pull request, @maxhaton! Bugzilla references
|
@@ -371,6 +371,8 @@ void buildAll(Bits bits, string branch, bool dmdOnly=false) | |||
} | |||
auto hostDMDEnv = " HOST_DC="~hostDMD~" HOST_DMD="~hostDMD; | |||
auto isRelease = " ENABLE_RELEASE=1"; | |||
//Enable lto for everything. | |||
auto ltoOption = " ENABLE_LTO=1"; |
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.
@maxhaton: Are you sure this actually works? I don't see ENABLE_LTO
being forwarded to build.d
in https://github.com/dlang/dmd/blob/master/src/posix.mak#L100.
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.
GNU make sets ENABLE_LTO=1
as an environment variable which is read by build.d
.
So make -f posix.mak ENABLE_LTO=1
works as expected.
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.
Hmm okay, but what about Windows with DigitalMars make? IIRC, there's a difference, and that's why all (?) other vars are forwarded explicitly. No ENABLE_LTO
forwarding in https://github.com/dlang/dmd/blob/master/src/win32.mak#L75 either.
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.
DM make doesn't seem to forward command line variables. So it needs to be explicitly forwarded in win32.mak
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.
It's how I recorded the data. I think no one bothered to add it since it
makes the build extremely slow
…On Thu, 13 Jan 2022, 09:33 Martin Kinkelin, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In create_dmd_release/create_dmd_release.d
<#492 (comment)>:
> @@ -371,6 +371,8 @@ void buildAll(Bits bits, string branch, bool dmdOnly=false)
}
auto hostDMDEnv = " HOST_DC="~hostDMD~" HOST_DMD="~hostDMD;
auto isRelease = " ENABLE_RELEASE=1";
+ //Enable lto for everything.
+ auto ltoOption = " ENABLE_LTO=1";
@maxhaton <https://github.com/maxhaton>: Are you sure this actually
works? I don't see ENABLE_LTO being forwarded to build.din
https://github.com/dlang/dmd/blob/master/src/posix.mak#L100.
—
Reply to this email directly, view it on GitHub
<#492 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLI75FK5GYHN545RCOVRYTUV2L55ANCNFSM5L2MI7AQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Another way of achieving the same optimization results (more or less) but probably way faster would be to simply compile all of DMD to a single object file, instead of the 3 separate lexer/frontend/backend object files. |
Hey @maxhaton, how did you generate and plot the graph? Do you use D for that as well? It would be interesting if you could capture the process. |
It was generated with mathematica, the data was collected with my own grubby mitts on the keyboard |
LTO isn't always plain sailing but let's try it.
A box & whisker plot of phobos test suite build times vs. flags