1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/lib/ProfileData
Pirama Arumuga Nainar 7b5dc69f32 [CoverageMapping] Handle gaps in counter IDs for source-based coverage
For source-based coverage, the frontend sets the counter IDs and the
constraints of counter IDs is not defined.  For e.g., the Rust frontend
until recently had a reserved counter #0
(https://github.com/rust-lang/rust/pull/83774).  Rust coverage
instrumentation also creates counters on edges in addition to basic
blocks.  Some functions may have more counters than regions.

This breaks an assumption in CoverageMapping.cpp where the number of
counters in a function is assumed to be bounded by the number of
regions:
  Counts.assign(Record.MappingRegions.size(), 0);

This assumption causes CounterMappingContext::evaluate() to fail since
there are not enough counter values created in the above call to
`Counts.assign`.  Consequently, some uncovered functions are not
reported in coverage reports.

This change walks a Function's CoverageMappingRecord to find the maximum
counter ID, and uses it to initialize the counter array when instrprof
records are missing for a function in sparse profiles.

Differential Revision: https://reviews.llvm.org/D101780
2021-05-19 10:46:38 -07:00
..
Coverage [CoverageMapping] Handle gaps in counter IDs for source-based coverage 2021-05-19 10:46:38 -07:00
CMakeLists.txt Revert "[SampleFDO][NFC] Refactor SampleProfile.cpp" 2021-02-16 22:11:42 +00:00
GCOV.cpp [SystemZ][z/OS][Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text 2021-04-06 07:23:31 -04:00
InstrProf.cpp [IndirectCallPromotion] Recommit "Don't strip ".__uniq." suffix when it strips 2021-03-12 13:48:14 -08:00
InstrProfReader.cpp [SystemZ][z/OS] Add IsText Argument to GetFile and GetFileOrSTDIN 2021-04-16 10:08:36 -04:00
InstrProfWriter.cpp [llvm-profdata] Emit Error when Invalid MemOpSize Section is Created by llvm-profdata 2021-02-23 12:51:54 -08:00
ProfileSummaryBuilder.cpp [CSSPGO][llvm-profdata] Support trimming cold context when merging profiles 2021-04-22 00:42:37 -07:00
SampleProf.cpp [CSSPGO] Fix dangling context strings and improve profile order consistency and error handling 2021-04-10 12:39:10 -07:00
SampleProfReader.cpp [SystemZ][z/OS] Add IsText Argument to GetFile and GetFileOrSTDIN 2021-04-16 10:08:36 -04:00
SampleProfWriter.cpp [CSSPGO] Explicitly disallow Binary and Compact Binary profile format for CSSPGO 2021-04-26 09:10:24 -07:00