www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Profile Guide Optimization on LDC2 -emit-llvm

reply Prasun Anand <prasunanand.bitsp gmail.com> writes:
Hi,

Recently, I wrote a software in D. I am using ldc2 1.1.0 (DMD 
v2.071.2, LLVM 3.7.1) for compiling. I am interested in PGO and 
profiled the project with 
[ldc-profdata](https://wiki.dlang.org/LDC_LLVM_profiling_instrumentation).

However, I wanted to get a full-report of profiling-data. I find 
that ldc-profdata
provides only two options i.e. show(not very helpful) and merge.

clang is able to generate .bc files that creates report by adding 
an
option -emit-llvm.

How can I get a full-report of profiling data?

Regards,
Prasun
Mar 26 2017
parent reply David Nadlinger via digitalmars-d-ldc <digitalmars-d-ldc puremagic.com> writes:
Hi,

On 27 Mar 2017, at 8:28, Prasun Anand via digitalmars-d-ldc wrote:
 clang is able to generate .bc files that creates report by adding an
 option -emit-llvm.
-emit-llvm causes Clang to emit bitcode instead of object files, and LLVM IR instead of textual assembly. The LDC equivalents are -output-ll and -output-bc, respectively. I don't think I have used the report you mention myself, so I'm unsure how it relates to that – could you give an example or a link to the corresponding Clang documentation? — David
Mar 27 2017
parent reply Prasun Anand <prasunanand.bitsp gmail.com> writes:
On Monday, 27 March 2017 at 12:33:04 UTC, David Nadlinger wrote:
 Hi,

 On 27 Mar 2017, at 8:28, Prasun Anand via digitalmars-d-ldc 
 wrote:
 clang is able to generate .bc files that creates report by 
 adding an
 option -emit-llvm.
-emit-llvm causes Clang to emit bitcode instead of object files, and LLVM IR instead of textual assembly. The LDC equivalents are -output-ll and -output-bc, respectively. I don't think I have used the report you mention myself, so I'm unsure how it relates to that – could you give an example or a link to the corresponding Clang documentation? — David
Thanks David, I was looking for how to output bc files and LLVM IR. Sorry, I am new to LLVM naming conventions. So, I was referring to bitcode and LLVM IR as reports. Regards, Prasun
Mar 27 2017
next sibling parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Monday, 27 March 2017 at 17:50:28 UTC, Prasun Anand wrote:
 On Monday, 27 March 2017 at 12:33:04 UTC, David Nadlinger wrote:
 Hi,

 On 27 Mar 2017, at 8:28, Prasun Anand via digitalmars-d-ldc 
 wrote:
 [...]
-emit-llvm causes Clang to emit bitcode instead of object files, and LLVM IR instead of textual assembly. The LDC equivalents are -output-ll and -output-bc, respectively. I don't think I have used the report you mention myself, so I'm unsure how it relates to that – could you give an example or a link to the corresponding Clang documentation? — David
Thanks David, I was looking for how to output bc files and LLVM IR. Sorry, I am new to LLVM naming conventions. So, I was referring to bitcode and LLVM IR as reports. Regards, Prasun
`-output-bc` and `-output-ll`
Mar 27 2017
prev sibling parent reply David Nadlinger via digitalmars-d-ldc <digitalmars-d-ldc puremagic.com> writes:
Hi Prasun,

On 27 Mar 2017, at 19:50, Prasun Anand via digitalmars-d-ldc wrote:
 Sorry, I am new to LLVM naming conventions. So, I was referring to 
 bitcode and LLVM IR as reports.
No worries, I was just not sure what you were referring to. Actually, to be fully correct, bitcode is LLVM IR as well, and I should really be speaking about its textual vs. binary forms. — David
Apr 03 2017
parent Prasun Anand <prasunanand.bitsp gmail.com> writes:
On Monday, 3 April 2017 at 21:52:46 UTC, David Nadlinger wrote:
 Hi Prasun,

 On 27 Mar 2017, at 19:50, Prasun Anand via digitalmars-d-ldc 
 wrote:
 Sorry, I am new to LLVM naming conventions. So, I was 
 referring to bitcode and LLVM IR as reports.
No worries, I was just not sure what you were referring to. Actually, to be fully correct, bitcode is LLVM IR as well, and I should really be speaking about its textual vs. binary forms. — David
Thanks Nicholas and David. I have been using gperftools and LLVM IR to understand how PGO works and for optimizing my project :) . Regards, Prasun
Apr 05 2017