[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
----------------
minglotus-6 wrote:

Mentioned version compatibility guarantees for raw and indexed format.

And mention the endianness where `Magic` field for raw profile header is documented, since the `Magic` field is used by raw profile reader to decide whether to swap bytes.

Relatedly, created https://github.com/llvm/llvm-project/pull/76312 to fix one issue related with endiannness.

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


More information about the llvm-commits mailing list