[clang] 13bd6fb - [docs/Coverage] Answer FAQ about optimization

Vedant Kumar via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 12 12:06:38 PST 2021


Author: Vedant Kumar
Date: 2021-02-12T12:05:38-08:00
New Revision: 13bd6fb43da9e9b1d7e82272325ec781d1f16456

URL: https://github.com/llvm/llvm-project/commit/13bd6fb43da9e9b1d7e82272325ec781d1f16456
DIFF: https://github.com/llvm/llvm-project/commit/13bd6fb43da9e9b1d7e82272325ec781d1f16456.diff

LOG: [docs/Coverage] Answer FAQ about optimization

Added: 
    

Modified: 
    clang/docs/SourceBasedCodeCoverage.rst

Removed: 
    


################################################################################
diff  --git a/clang/docs/SourceBasedCodeCoverage.rst b/clang/docs/SourceBasedCodeCoverage.rst
index 90feb41b0a3f..b9cfe0f90297 100644
--- a/clang/docs/SourceBasedCodeCoverage.rst
+++ b/clang/docs/SourceBasedCodeCoverage.rst
@@ -305,6 +305,19 @@ Format compatibility guarantees
   minor version increment is for added functionality, and patch version
   increments are for bugfixes.
 
+Impact of llvm optimizations on coverage reports
+================================================
+
+llvm optimizations (such as inlining or CFG simplification) should have no
+impact on coverage report quality. This is due to the fact that the mapping
+from source regions to profile counters is immutable, and is generated before
+the llvm optimizer kicks in. The optimizer can't prove that profile counter
+instrumentation is safe to delete (because it's not: it affects the profile the
+program emits), and so leaves it alone.
+
+Note that this coverage feature does not rely on information that can degrade
+during the course of optimization, such as debug info line tables.
+
 Using the profiling runtime without static initializers
 =======================================================
 


        


More information about the cfe-commits mailing list