<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/lib/CodeGen/CoverageMappingGen.cpp, branch users/nico/python-1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[PGO][Offload] Fix offload coverage mapping  (#143490)</title>
<updated>2025-06-11T01:19:38+00:00</updated>
<author>
<name>Ethan Luis McDonough</name>
<email>ethanluismcdonough@gmail.com</email>
</author>
<published>2025-06-11T01:19:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=67ff66e67734c0b283ec676899e5b89b67fdafcb'/>
<id>67ff66e67734c0b283ec676899e5b89b67fdafcb</id>
<content type='text'>
This pull request fixes coverage mapping on GPU targets. 

- It adds an address space cast to the coverage mapping generation pass.
- It reads the profiled function names from the ELF directly. Reading it
from public globals was causing issues in cases where multiple
device-code object files are linked together.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This pull request fixes coverage mapping on GPU targets. 

- It adds an address space cast to the coverage mapping generation pass.
- It reads the profiled function names from the ELF directly. Reading it
from public globals was causing issues in cases where multiple
device-code object files are linked together.</pre>
</div>
</content>
</entry>
<entry>
<title>[CodeGen] Move CodeGenPGO behind unique_ptr (NFC) (#142155)</title>
<updated>2025-06-02T07:51:54+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2025-06-02T07:51:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e2b536431d85c49cdfad5106d116ced683a0667a'/>
<id>e2b536431d85c49cdfad5106d116ced683a0667a</id>
<content type='text'>
The InstrProf headers are very expensive. Avoid including them in all of
CodeGen/ by moving the CodeGenPGO member behind a unqiue_ptr.

This reduces clang build time by 0.8%.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The InstrProf headers are very expensive. Avoid including them in all of
CodeGen/ by moving the CodeGenPGO member behind a unqiue_ptr.

This reduces clang build time by 0.8%.</pre>
</div>
</content>
</entry>
<entry>
<title>[Coverage] Fix mapping for do-while loops with terminating statements (#139777)</title>
<updated>2025-05-19T19:49:26+00:00</updated>
<author>
<name>Justin Cady</name>
<email>desk@justincady.com</email>
</author>
<published>2025-05-19T19:49:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=025639bc396f1e0d2ead279c5f345cb381733f16'/>
<id>025639bc396f1e0d2ead279c5f345cb381733f16</id>
<content type='text'>
The current region mapping for do-while loops that contain statements
such as break or continue results in inaccurate line coverage reports
for the line following the loop.

This change handles terminating statements the same way that other loop
constructs do, correcting the region mapping for accurate reports. It
also fixes a fragile test relying on exact line numbers.

Fixes #139122</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current region mapping for do-while loops that contain statements
such as break or continue results in inaccurate line coverage reports
for the line following the loop.

This change handles terminating statements the same way that other loop
constructs do, correcting the region mapping for accurate reports. It
also fixes a fragile test relying on exact line numbers.

Fixes #139122</pre>
</div>
</content>
</entry>
<entry>
<title>Reland [Coverage] Fix region termination for GNU statement expressions (#132222)</title>
<updated>2025-03-21T15:59:01+00:00</updated>
<author>
<name>Justin Cady</name>
<email>desk@justincady.com</email>
</author>
<published>2025-03-21T15:59:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=954a3de7838a8c496ef1d1730127415b3e9786f9'/>
<id>954a3de7838a8c496ef1d1730127415b3e9786f9</id>
<content type='text'>
Relands #130976 with adjustments to test requirements.

Calls to __noreturn__ functions result in region termination for
coverage mapping. But this creates incorrect coverage results when
__noreturn__ functions (or other constructs that result in region
termination) occur within [GNU statement expressions][1].

In this scenario an extra gap region is introduced within VisitStmt,
such that if the following line does not introduce a new region it
is unconditionally counted as uncovered.

This change adjusts the mapping such that terminate statements
within statement expressions do not propagate that termination
state after the statement expression is processed.

[1]: https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

Fixes #124296</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Relands #130976 with adjustments to test requirements.

Calls to __noreturn__ functions result in region termination for
coverage mapping. But this creates incorrect coverage results when
__noreturn__ functions (or other constructs that result in region
termination) occur within [GNU statement expressions][1].

In this scenario an extra gap region is introduced within VisitStmt,
such that if the following line does not introduce a new region it
is unconditionally counted as uncovered.

This change adjusts the mapping such that terminate statements
within statement expressions do not propagate that termination
state after the statement expression is processed.

[1]: https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

Fixes #124296</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[Coverage] Fix region termination for GNU statement expressions" (#132095)</title>
<updated>2025-03-19T20:48:34+00:00</updated>
<author>
<name>Justin Cady</name>
<email>desk@justincady.com</email>
</author>
<published>2025-03-19T20:48:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bd2d8c0a7ee196cc60ab0d46d6fab416b1697ae1'/>
<id>bd2d8c0a7ee196cc60ab0d46d6fab416b1697ae1</id>
<content type='text'>
Reverts llvm/llvm-project#130976

Breaks clang-cmake-x86_64-avx512-linux bot.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#130976

Breaks clang-cmake-x86_64-avx512-linux bot.</pre>
</div>
</content>
</entry>
<entry>
<title>[Coverage] Fix region termination for GNU statement expressions (#130976)</title>
<updated>2025-03-19T20:22:26+00:00</updated>
<author>
<name>Justin Cady</name>
<email>desk@justincady.com</email>
</author>
<published>2025-03-19T20:22:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0827e3aae6eb69c2a6fa842ffa780881feb45b5d'/>
<id>0827e3aae6eb69c2a6fa842ffa780881feb45b5d</id>
<content type='text'>
Calls to __noreturn__ functions result in region termination for
coverage mapping. But this creates incorrect coverage results when
__noreturn__ functions (or other constructs that result in region
termination) occur within [GNU statement expressions][1].

In this scenario an extra gap region is introduced within VisitStmt,
such that if the following line does not introduce a new region it
is unconditionally counted as uncovered.

This change adjusts the mapping such that terminate statements
within statement expressions do not propagate that termination
state after the statement expression is processed.

[1]: https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

Fixes #124296</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Calls to __noreturn__ functions result in region termination for
coverage mapping. But this creates incorrect coverage results when
__noreturn__ functions (or other constructs that result in region
termination) occur within [GNU statement expressions][1].

In this scenario an extra gap region is introduced within VisitStmt,
such that if the following line does not introduce a new region it
is unconditionally counted as uncovered.

This change adjusts the mapping such that terminate statements
within statement expressions do not propagate that termination
state after the statement expression is processed.

[1]: https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

Fixes #124296</pre>
</div>
</content>
</entry>
<entry>
<title>[Coverage] Introduce the type `CounterPair` for RegionCounterMap. NFC. (#112724)</title>
<updated>2025-01-09T08:11:07+00:00</updated>
<author>
<name>NAKAMURA Takumi</name>
<email>geek4civic@gmail.com</email>
</author>
<published>2025-01-09T08:11:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=397ac44f623f891d8f05d6673a95984ac0a26671'/>
<id>397ac44f623f891d8f05d6673a95984ac0a26671</id>
<content type='text'>
`CounterPair` can hold `&lt;uint32_t, uint32_t&gt;` instead of current
`unsigned`, to hold also the counter number of SkipPath. For now, this
change provides the skeleton and only `CounterPair::Executed` is used.

Each counter number can have `None` to suppress emitting counter
increment. 2nd element `Skipped` is initialized as `None` by default,
since most `Stmt*` don't have a pair of counters.

This change also provides stubs for the verifier. I'll provide the impl
of verifier for `+Asserts` later.

`markStmtAsUsed(bool, Stmt*)` may be used to inform that other side
counter may not emitted.

`markStmtMaybeUsed(S)` may be used for the `Stmt` and its inner will be
excluded for emission in the case of skipping by constant folding. I put
it into places where I found.

`verifyCounterMap()` will check the coverage map and the counter map,
and can be used to report inconsistency.

These verifier methods shall be eliminated in `-Asserts`.


https://discourse.llvm.org/t/rfc-integrating-singlebytecoverage-with-branch-coverage/82492</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`CounterPair` can hold `&lt;uint32_t, uint32_t&gt;` instead of current
`unsigned`, to hold also the counter number of SkipPath. For now, this
change provides the skeleton and only `CounterPair::Executed` is used.

Each counter number can have `None` to suppress emitting counter
increment. 2nd element `Skipped` is initialized as `None` by default,
since most `Stmt*` don't have a pair of counters.

This change also provides stubs for the verifier. I'll provide the impl
of verifier for `+Asserts` later.

`markStmtAsUsed(bool, Stmt*)` may be used to inform that other side
counter may not emitted.

`markStmtMaybeUsed(S)` may be used for the `Stmt` and its inner will be
excluded for emission in the case of skipping by constant folding. I put
it into places where I found.

`verifyCounterMap()` will check the coverage map and the counter map,
and can be used to report inconsistency.

These verifier methods shall be eliminated in `-Asserts`.


https://discourse.llvm.org/t/rfc-integrating-singlebytecoverage-with-branch-coverage/82492</pre>
</div>
</content>
</entry>
<entry>
<title>[Coverage] Introduce `getBranchCounterPair()`. NFC. (#112702)</title>
<updated>2025-01-09T07:47:01+00:00</updated>
<author>
<name>NAKAMURA Takumi</name>
<email>geek4civic@gmail.com</email>
</author>
<published>2025-01-09T07:47:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f5cd181ffbb7cb61d582fe130d46580d5969d47a'/>
<id>f5cd181ffbb7cb61d582fe130d46580d5969d47a</id>
<content type='text'>
This aggregates the generation of branch counter pair as `ExecCnt` and
`SkipCnt`, to aggregate `CounterExpr::subtract`. At the moment:

- This change preserves the behavior of
`llvm::EnableSingleByteCoverage`. Almost of SingleByteCoverage will be
cleaned up by coming commits.

- `IsCounterEqual(Out, Par)` is introduced instead of
`Counter::operator==`. Tweaks would be required for the comparison for
additional counters.


https://discourse.llvm.org/t/rfc-integrating-singlebytecoverage-with-branch-coverage/82492</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This aggregates the generation of branch counter pair as `ExecCnt` and
`SkipCnt`, to aggregate `CounterExpr::subtract`. At the moment:

- This change preserves the behavior of
`llvm::EnableSingleByteCoverage`. Almost of SingleByteCoverage will be
cleaned up by coming commits.

- `IsCounterEqual(Out, Par)` is introduced instead of
`Counter::operator==`. Tweaks would be required for the comparison for
additional counters.


https://discourse.llvm.org/t/rfc-integrating-singlebytecoverage-with-branch-coverage/82492</pre>
</div>
</content>
</entry>
<entry>
<title>[Coverage] Resurrect Branch:FalseCnt in SwitchStmt that was pruned in #112694 (#120418)</title>
<updated>2024-12-18T23:41:07+00:00</updated>
<author>
<name>NAKAMURA Takumi</name>
<email>geek4civic@gmail.com</email>
</author>
<published>2024-12-18T23:41:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ef955908302b6a6170e9775d89a94846fde12ebf'/>
<id>ef955908302b6a6170e9775d89a94846fde12ebf</id>
<content type='text'>
I missed that FalseCnt for each Case was used to calculate percentage in
the SwitchStmt. At the moment I resurrect them.

In `!HasDefaultCase`, the pair of Counters shall be `[CaseCountSum,
FalseCnt]`. (Reversal of before #112694)
I think it can be considered as the False count on SwitchStmt.

FalseCnt shall be folded (same as current impl) in the coming
SingleByteCoverage changes, since percentage would not make sense.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I missed that FalseCnt for each Case was used to calculate percentage in
the SwitchStmt. At the moment I resurrect them.

In `!HasDefaultCase`, the pair of Counters shall be `[CaseCountSum,
FalseCnt]`. (Reversal of before #112694)
I think it can be considered as the False count on SwitchStmt.

FalseCnt shall be folded (same as current impl) in the coming
SingleByteCoverage changes, since percentage would not make sense.</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce CounterMappingRegion::isBranch(). NFC.</title>
<updated>2024-12-18T11:00:02+00:00</updated>
<author>
<name>NAKAMURA Takumi</name>
<email>geek4civic@gmail.com</email>
</author>
<published>2024-12-18T10:53:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5a5838fba37153adb7885c897131dda09227eb2d'/>
<id>5a5838fba37153adb7885c897131dda09227eb2d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
