LLVM profiling

Hi guys,

I am trying to perform edge profiling using on hello.bc file by using
following command

opt -insert-edge-profiling hello.bc -o hello-edge.bc

but I get the error that option "-insert-edge-profiling" is unknown. Can
you please help me to solve the issue. Please note that I am following the
paper available at this link
http://llvm.org/pubs/2010-12-Preuss-PathProfiling.pdf

Thanks

Naveed Ul Mustafa

Dear Naveed,

Have you verified that edge profiling was integrated into LLVM? This paper applies a patch to an older version of LLVM to add the edge profiling feature, so it looks like edge profiling wasn't integrated into LLVM at that time. It's not clear to me whether it was added after the paper was published and whether that feature still exists.

A simple grep on trunk does not show an LLVM pass providing the insert-edge-profiling command line option. A quick Google search shows something like an edge profiling pass in LLVM 3.3 (https://llvm.org/svn/llvm-project/llvm/branches/release_33/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp), but I don't see that code in LLVM trunk now.

I don't use LLVM's profiling features myself. Other people that work on the profiling code can better tell you whether edge profiling exists in LLVM now or existed in a previous version. If you don't hear from anyone within the next few days, please start a new thread on the mailing list with a subject of "Edge Profiling Support" (a more specific thread title can sometimes elicit more responses).

Regards,

John Criswell

It is currently done in Clang FE: tools/clang/lib/CodeGen/CodeGenPGO.cpp – CodeGenPGO::assignRegionCounters(…)

David

That's correct. There is no edge profiling implementation in LLVM at this time.

Diego.

"Naveed Ul Mustafa" <naveed.mustafa@bilkent.edu.tr> writes:

Hi guys,

I am trying to perform edge profiling using on hello.bc file by using
following command

opt -insert-edge-profiling hello.bc -o hello-edge.bc

This flag has been gone since 2013 or so. The profiling infrastructure
this was part of was removed because it was unmaintained and getting in
the way of newer PGO efforts.

There is some information about PGO with today's clang in the user manual:

  Clang Compiler User’s Manual — Clang 16.0.0git documentation