LDC PGO on Windows

Imperatorn johan_forsberg_86 at hotmail.com
Tue Oct 17 08:59:52 UTC 2023


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:

```d
"dflags": ["-m64", "-release" ,"-fprofile-instr-generate"]
```

Then just:
```d
dub build --compiler=ldc2
```

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


More information about the Digitalmars-d mailing list