Does PGO work on Windows with LDC?
If so, how do I use it? Been trying to follow the information available but get various errors related to linker or runtime errors.
Is it supported on Windows?
Thanks
Thread overview | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
October 16, 2023 LDC PGO on Windows | ||||
---|---|---|---|---|
| ||||
Does PGO work on Windows with LDC? If so, how do I use it? Been trying to follow the information available but get various errors related to linker or runtime errors. Is it supported on Windows? Thanks |
October 16, 2023 Re: LDC PGO on Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Imperatorn | On Monday, 16 October 2023 at 17:00:41 UTC, Imperatorn wrote: >Does PGO work on Windows with LDC? If so, how do I use it? Been trying to follow the information available but get various errors related to linker or runtime errors. Is it supported on Windows? Thanks With msvc I get And with link-internally I get |
October 16, 2023 Re: LDC PGO on Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Imperatorn | On Monday, 16 October 2023 at 17:13:04 UTC, Imperatorn wrote: >On Monday, 16 October 2023 at 17:00:41 UTC, Imperatorn wrote: >Does PGO work on Windows with LDC? If so, how do I use it? Been trying to follow the information available but get various errors related to linker or runtime errors. Is it supported on Windows? Thanks With msvc I get And with link-internally I get I get the same on Linux: And trying a minimal example gives me: Exception Code: 0xC000001D |
October 16, 2023 Re: LDC PGO on Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Imperatorn | On Monday, 16 October 2023 at 17:43:21 UTC, Imperatorn wrote: >On Monday, 16 October 2023 at 17:13:04 UTC, Imperatorn wrote: >On Monday, 16 October 2023 at 17:00:41 UTC, Imperatorn wrote: >[...] With msvc I get And with link-internally I get I get the same on Linux: And trying a minimal example gives me: Exception Code: 0xC000001D After some experimentation it turned out it was working after all, but not with any code and dependencies. For example in my case, if I removed asdf deserialize, it worked, but if I introduced it again, I got a bunch of errors like this
|
October 17, 2023 Re: LDC PGO on Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Imperatorn | On Monday, 16 October 2023 at 18:10:21 UTC, Imperatorn wrote: >On Monday, 16 October 2023 at 17:43:21 UTC, Imperatorn wrote: >On Monday, 16 October 2023 at 17:13:04 UTC, Imperatorn wrote: >On Monday, 16 October 2023 at 17:00:41 UTC, Imperatorn wrote: For documentation purposes I will share the solution here. The problem was I was using dub and didn't know how to forward everything correctly as dflags. In your dflags, supply something like this, do not add -of=test or whatever, dub will overwrite it:
Then just:
This will produce an executable with the same name as you specified in your dub config. Now you run that and it will produce an output file that you will convert. The rest of the steps can be read here: https://johanengelen.github.io/ldc/2016/07/15/Profile-Guided-Optimization-with-LDC.html |
October 17, 2023 Re: LDC PGO on Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Imperatorn | On Tuesday, 17 October 2023 at 08:59:52 UTC, Imperatorn wrote: >On Monday, 16 October 2023 at 18:10:21 UTC, Imperatorn wrote: >On Monday, 16 October 2023 at 17:43:21 UTC, Imperatorn wrote: >On Monday, 16 October 2023 at 17:13:04 UTC, Imperatorn wrote: >On Monday, 16 October 2023 at 17:00:41 UTC, Imperatorn wrote: If you are having trouble using the above, try the following instead:
The complete process for dub (replace {programname} with your program name):
All the above steps in a script, but without dub, assuming app.d is in source Windows:
*nix:
|
October 17, 2023 Re: LDC PGO on Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Imperatorn | On Tuesday, 17 October 2023 at 13:00:54 UTC, Imperatorn wrote: >On Tuesday, 17 October 2023 at 08:59:52 UTC, Imperatorn wrote: > > > >[...] If you are having trouble using the above, try the following instead: [...] Is there any way to incorporate some of what you figured out into It might also make sense to file an issue with dub about streamlining the process. I only see one issue currently that references PGO. |
October 17, 2023 Re: LDC PGO on Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Imperatorn | On Tuesday, 17 October 2023 at 13:00:54 UTC, Imperatorn wrote: >On Tuesday, 17 October 2023 at 08:59:52 UTC, Imperatorn wrote: > > > >[...] If you are having trouble using the above, try the following instead: [...] A typo: It should be
not
|
October 21, 2023 Re: LDC PGO on Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to jmh530 | On Tuesday, 17 October 2023 at 13:42:24 UTC, jmh530 wrote: >On Tuesday, 17 October 2023 at 13:00:54 UTC, Imperatorn wrote: >On Tuesday, 17 October 2023 at 08:59:52 UTC, Imperatorn wrote: > > > >[...] If you are having trouble using the above, try the following instead: [...] Is there any way to incorporate some of what you figured out into It might also make sense to file an issue with dub about streamlining the process. I only see one issue currently that references PGO. Put another link here. For future "new documentation project": |
October 21, 2023 Re: LDC PGO on Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sergey | On Saturday, 21 October 2023 at 11:31:54 UTC, Sergey wrote: >On Tuesday, 17 October 2023 at 13:42:24 UTC, jmh530 wrote: >On Tuesday, 17 October 2023 at 13:00:54 UTC, Imperatorn wrote: >[...] Is there any way to incorporate some of what you figured out into It might also make sense to file an issue with dub about streamlining the process. I only see one issue currently that references PGO. Put another link here. For future "new documentation project": Thanks for the links! |