[llvm] [compiler-rt] [docs][IRPGO]Document two binary formats for IRPGO profiles (PR #76105)

Mingming Liu via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 09:17:20 PST 2024


================
@@ -0,0 +1,395 @@
+===================================
+Instrumentation PGO Profile Format
+===================================
+
+.. contents::
+   :local:
+
+
+Overview
+=========
+
+Instrumentation PGO inserts `llvm.instrprof.*` `code generator intrinsics`_
+in the code to generate profiles. This document describes two binary profile
+formats (raw and indexed) used by instrumentation.
+
+.. _`code generator intrinsics`: https://llvm.org/docs/LangRef.html#code-generator-intrinsics
+
+.. note::
+  The instrumentation profile format supports non-PGO use cases (e.g., temporal
+  profiling). This document will focus on PGO. Source coverage uses both
+  frontend instrumentation profiles and coverage mapping. The format for
+  coverage mapping has its own `documentation`_.
+
+.. _`documentation`: https://llvm.org/docs/CoverageMappingFormat.html
+
+Raw Profile Format
+===================
+
+The raw profile is generated by running the instrumented binary. It is a memory
+dump of the profile data.
----------------
minglotus-6 wrote:

I wonder if the comment means to say 's/profile data/profile counters'?

Nevertheless, I revised this to `The raw profile
data from an executable or a shared library consists of a header and
multiple sections, with each section as a memory dump. The profile raw data needs
to be reasonably compact and fast to generate.`. PTAL.


https://github.com/llvm/llvm-project/pull/76105


More information about the llvm-commits mailing list