<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/clang/test/CodeGen/code-coverage-tsan.c, branch users/nico/python-2</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>[tsan] Respect !nosanitize metadata and remove gcov special case</title>
<updated>2023-08-25T05:31:11+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2023-08-25T05:31:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5624e86ae0fb259c6069d1cc7d5eaa24402f9134'/>
<id>5624e86ae0fb259c6069d1cc7d5eaa24402f9134</id>
<content type='text'>
Certain instrumentations set the !nosanitize metadata for inserted
instructions, which are generally not interested for sanitizers. Skip
tsan instrumentation like we do for asan (D126294)/msan/hwasan.

-fprofile-arcs instrumentation has data race unless
-fprofile-update=atomic is specified. Let's remove the the `__llvm_gcov`
special case from commit 0222adbcd25779a156399bcc16fde9f6d083a809 (2016)
as the racy instructions have the !nosanitize metadata.
(-fprofile-arcs instrumentation does not use `__llvm_gcda` as global variables.)

```
std::atomic&lt;int&gt; c;
void foo() { c++; }
int main() {
  std::thread th(foo);
  c++;
  th.join();
}
```
Tested that `clang++ --coverage -fsanitize=thread a.cc &amp;&amp; ./a.out` does
not report spurious tsan errors.

Also remove the default CC1 option -fprofile-update=atomic for
-fsanitize=thread to make options more orthogonal.

Reviewed By: Enna1

Differential Revision: https://reviews.llvm.org/D158385
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Certain instrumentations set the !nosanitize metadata for inserted
instructions, which are generally not interested for sanitizers. Skip
tsan instrumentation like we do for asan (D126294)/msan/hwasan.

-fprofile-arcs instrumentation has data race unless
-fprofile-update=atomic is specified. Let's remove the the `__llvm_gcov`
special case from commit 0222adbcd25779a156399bcc16fde9f6d083a809 (2016)
as the racy instructions have the !nosanitize metadata.
(-fprofile-arcs instrumentation does not use `__llvm_gcda` as global variables.)

```
std::atomic&lt;int&gt; c;
void foo() { c++; }
int main() {
  std::thread th(foo);
  c++;
  th.join();
}
```
Tested that `clang++ --coverage -fsanitize=thread a.cc &amp;&amp; ./a.out` does
not report spurious tsan errors.

Also remove the default CC1 option -fprofile-update=atomic for
-fsanitize=thread to make options more orthogonal.

Reviewed By: Enna1

Differential Revision: https://reviews.llvm.org/D158385
</pre>
</div>
</content>
</entry>
<entry>
<title>[gcov] Use Joined = form for -coverage-notes-file and -coverage-data-file</title>
<updated>2023-08-15T21:49:02+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2023-08-15T21:49:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=64473f1221fbc16af140407d5ea64d808f5853a7'/>
<id>64473f1221fbc16af140407d5ea64d808f5853a7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[gcov] Simplify cc1 options and remove CodeGenOptions EmitCovNotes/EmitCovArcs</title>
<updated>2023-05-17T23:09:12+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2023-05-17T23:09:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=71a35f7e3d6c78f8035f2eb7d58beba3b7208f9d'/>
<id>71a35f7e3d6c78f8035f2eb7d58beba3b7208f9d</id>
<content type='text'>
After a07b135ce0c0111bd83450b5dc29ef0381cdbc39, we always pass
-coverage-notes-file/-coverage-data-file for driver options
-ftest-coverage/-fprofile-arcs/--coverage. As a bonus, we can make the following
simplification to cc1 options:

* `-ftest-coverage -coverage-notes-file a.gcno` =&gt; `-coverage-notes-file a.gcno`
* `-fprofile-arcs -coverage-data-file a.gcda` =&gt; `-coverage-data-file a.gcda`

and remove EmitCovNotes/EmitCovArcs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After a07b135ce0c0111bd83450b5dc29ef0381cdbc39, we always pass
-coverage-notes-file/-coverage-data-file for driver options
-ftest-coverage/-fprofile-arcs/--coverage. As a bonus, we can make the following
simplification to cc1 options:

* `-ftest-coverage -coverage-notes-file a.gcno` =&gt; `-coverage-notes-file a.gcno`
* `-fprofile-arcs -coverage-data-file a.gcda` =&gt; `-coverage-data-file a.gcda`

and remove EmitCovNotes/EmitCovArcs.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Clang] Convert some tests to opaque pointers (NFC)</title>
<updated>2023-03-10T13:43:42+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-03-10T10:36:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a20874276be777bed4f34c52438efd66798c2ec5'/>
<id>a20874276be777bed4f34c52438efd66798c2ec5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC)</title>
<updated>2022-04-07T10:09:47+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2022-04-07T10:03:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=532dc62b907554b3f07f17205674aa71e76fc863'/>
<id>532dc62b907554b3f07f17205674aa71e76fc863</id>
<content type='text'>
This adds -no-opaque-pointers to clang tests whose output will
change when opaque pointers are enabled by default. This is
intended to be part of the migration approach described in
https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9.

The patch has been produced by replacing %clang_cc1 with
%clang_cc1 -no-opaque-pointers for tests that fail with opaque
pointers enabled. Worth noting that this doesn't cover all tests,
there's a remaining ~40 tests not using %clang_cc1 that will need
a followup change.

Differential Revision: https://reviews.llvm.org/D123115
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds -no-opaque-pointers to clang tests whose output will
change when opaque pointers are enabled by default. This is
intended to be part of the migration approach described in
https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9.

The patch has been produced by replacing %clang_cc1 with
%clang_cc1 -no-opaque-pointers for tests that fail with opaque
pointers enabled. Worth noting that this doesn't cover all tests,
there's a remaining ~40 tests not using %clang_cc1 that will need
a followup change.

Differential Revision: https://reviews.llvm.org/D123115
</pre>
</div>
</content>
</entry>
<entry>
<title>Use functions with prototypes when appropriate; NFC</title>
<updated>2022-02-15T14:28:02+00:00</updated>
<author>
<name>Aaron Ballman</name>
<email>aaron@aaronballman.com</email>
</author>
<published>2022-02-15T14:27:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ed509fe296375eb7c01d3d9aeec15cc784695210'/>
<id>ed509fe296375eb7c01d3d9aeec15cc784695210</id>
<content type='text'>
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&amp;R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the tenth batch of tests being updated (there are a
significant number of other tests left to be updated).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&amp;R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the tenth batch of tests being updated (there are a
significant number of other tests left to be updated).
</pre>
</div>
</content>
</entry>
<entry>
<title>NFC: update clang tests to check ordering and alignment for atomicrmw/cmpxchg.</title>
<updated>2021-02-11T22:35:09+00:00</updated>
<author>
<name>James Y Knight</name>
<email>jyknight@google.com</email>
</author>
<published>2021-02-11T22:33:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8043d5a9643b5731454fce91fac0018bfddc96d6'/>
<id>8043d5a9643b5731454fce91fac0018bfddc96d6</id>
<content type='text'>
The ability to specify alignment was recently added, and it's an
important property which we should ensure is set as expected by
Clang. (Especially before making further changes to Clang's code in
this area.) But, because it's on the end of the lines, the existing
tests all ignore it.

Therefore, update all the tests to also verify the expected alignment
for atomicrmw and cmpxchg. While I was in there, I also updated uses
of 'load atomic' and 'store atomic', and added the memory ordering,
where that was missing.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ability to specify alignment was recently added, and it's an
important property which we should ensure is set as expected by
Clang. (Especially before making further changes to Clang's code in
this area.) But, because it's on the end of the lines, the existing
tests all ignore it.

Therefore, update all the tests to also verify the expected alignment
for atomicrmw and cmpxchg. While I was in there, I also updated uses
of 'load atomic' and 'store atomic', and added the memory ordering,
where that was missing.
</pre>
</div>
</content>
</entry>
<entry>
<title>[gcov] Unify driver and CC1 option names for -ftest-coverage &amp; -fprofile-arcs</title>
<updated>2020-10-20T05:19:00+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2020-10-20T05:17:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=545c687c4b06b403915b92f422ddad737a6357b9'/>
<id>545c687c4b06b403915b92f422ddad737a6357b9</id>
<content type='text'>
No need to use -femit-coverage-notes and -femit-coverage-data.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No need to use -femit-coverage-notes and -femit-coverage-data.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add -fprofile-update={atomic,prefer-atomic,single}</title>
<updated>2020-09-29T17:43:23+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2020-09-29T17:38:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3681be876fea9b270c7a1d2dc41679a399610e06'/>
<id>3681be876fea9b270c7a1d2dc41679a399610e06</id>
<content type='text'>
GCC 7 introduced -fprofile-update={atomic,prefer-atomic} (prefer-atomic is for
best efforts (some targets do not support atomics)) to increment counters
atomically, which is exactly what we have done with -fprofile-instr-generate
(D50867) and -fprofile-arcs (b5ef137c11b1cc6ae839ee75b49233825772bdd0).
This patch adds the option to clang to surface the internal options at driver level.

GCC 7 also turned on -fprofile-update=prefer-atomic when -pthread is specified,
but it has performance regression
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89307). So we don't follow suit.

Differential Revision: https://reviews.llvm.org/D87737
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GCC 7 introduced -fprofile-update={atomic,prefer-atomic} (prefer-atomic is for
best efforts (some targets do not support atomics)) to increment counters
atomically, which is exactly what we have done with -fprofile-instr-generate
(D50867) and -fprofile-arcs (b5ef137c11b1cc6ae839ee75b49233825772bdd0).
This patch adds the option to clang to surface the internal options at driver level.

GCC 7 also turned on -fprofile-update=prefer-atomic when -pthread is specified,
but it has performance regression
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89307). So we don't follow suit.

Differential Revision: https://reviews.llvm.org/D87737
</pre>
</div>
</content>
</entry>
<entry>
<title>[gcov] Add spanning tree optimization</title>
<updated>2020-09-13T07:07:31+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2020-09-13T07:07:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=63182c2ac0b643a60d397274e8a31166fc7243fa'/>
<id>63182c2ac0b643a60d397274e8a31166fc7243fa</id>
<content type='text'>
gcov is an "Edge Profiling with Edge Counters" application according to
Optimally Profiling and Tracing Programs (1994).

The minimum number of counters necessary is |E|-(|V|-1). The unmeasured edges
form a spanning tree. Both GCC --coverage and clang -fprofile-generate leverage
this optimization. This patch implements the optimization for clang --coverage.
The produced .gcda files are much smaller now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gcov is an "Edge Profiling with Edge Counters" application according to
Optimally Profiling and Tracing Programs (1994).

The minimum number of counters necessary is |E|-(|V|-1). The unmeasured edges
form a spanning tree. Both GCC --coverage and clang -fprofile-generate leverage
this optimization. This patch implements the optimization for clang --coverage.
The produced .gcda files are much smaller now.
</pre>
</div>
</content>
</entry>
</feed>
