public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v5] Add condition coverage profiling
@ 2023-10-04 12:38 Jørgen Kvalsvik
  2023-10-04 12:39 ` [PATCH 01/22] " Jørgen Kvalsvik
                   ` (21 more replies)
  0 siblings, 22 replies; 34+ messages in thread
From: Jørgen Kvalsvik @ 2023-10-04 12:38 UTC (permalink / raw)
  To: gcc-patches; +Cc: mliska, jh

This is an extended set of patches with both review feedback from the v4 set,
as well as a few serious bug fixes and improvements, plus test cases.

There has only been a small-ish adjustment to the algorithm itself, in
expression isolation step. Because of gotos this might need to run multiple
times if it is detected that the expression subgraph has more than two
neighbors (in which case it *must* be more than a single Boolean expression).
This fixes some problems that mostly happen under optimization, but it also
helps correctness by having extra checks that what we found satisifies some
fundamental properties. Most other bugs were implementation errors.

I have broken the work up into smaller pieces that fix a single issue
each, including addressing review feedback. I hope this will make the patch set
easier to review and check how comments are addressed, but it also means that
most of the patch set does not have a the proper commit format etc. I plan to
squash most, if not all, of the commits before merge where this will be
addressed.

In September I proposed [1] an idea on how to fix the if (a) if (b) {} counted
as if (a && b) problem. If such a fix should be implemented no real changes
will have to happen to the tree profiling, the only change necessary to the
tree profiling is updating the test to reflect the counting.

To test the compiler I have built all dependencies (libraries, programs) to
build git, systemd, and openjdk, which includes llvm, perl, python, openssl,
icu, valgrind, and elfutils. This list is non-exhaustive. All these programs
now *build* with coverage enabled without failing (hitting an assert), but I
have not verified counting for these programs.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631254.html

---

 gcc/builtins.cc                        |    2 +-
 gcc/collect2.cc                        |    7 +-
 gcc/common.opt                         |    9 +
 gcc/doc/gcov.texi                      |   38 +
 gcc/doc/invoke.texi                    |   21 +
 gcc/gcc.cc                             |    4 +-
 gcc/gcov-counter.def                   |    3 +
 gcc/gcov-dump.cc                       |   24 +
 gcc/gcov-io.h                          |    3 +
 gcc/gcov.cc                            |  209 ++++-
 gcc/ipa-inline.cc                      |    2 +-
 gcc/ipa-split.cc                       |    3 +-
 gcc/passes.cc                          |    3 +-
 gcc/profile.cc                         |   92 +-
 gcc/testsuite/g++.dg/gcov/gcov-18.C    |  246 ++++++
 gcc/testsuite/gcc.misc-tests/gcov-19.c | 1471 ++++++++++++++++++++++++++++++++
 gcc/testsuite/gcc.misc-tests/gcov-20.c |   22 +
 gcc/testsuite/gcc.misc-tests/gcov-21.c |   16 +
 gcc/testsuite/gcc.misc-tests/gcov-22.c |   71 ++
 gcc/testsuite/gcc.misc-tests/gcov-23.c |  149 ++++
 gcc/testsuite/lib/gcov.exp             |  191 ++++-
 gcc/tree-profile.cc                    | 1123 +++++++++++++++++++++++-
 libgcc/libgcov-merge.c                 |    5 +
 23 files changed, 3688 insertions(+), 26 deletions(-)



^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2023-10-23  8:10 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-04 12:38 [PATCH v5] Add condition coverage profiling Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 01/22] " Jørgen Kvalsvik
2023-10-05 12:59   ` Jan Hubicka
2023-10-05 13:39     ` Jørgen Kvalsvik
2023-10-05 14:17       ` Jørgen Kvalsvik
2023-10-05 14:39         ` Jan Hubicka
2023-10-21 14:30       ` Jørgen Kvalsvik
2023-10-23  8:10         ` Richard Biener
2023-10-05 15:18     ` Jørgen Kvalsvik
2023-10-06  9:49     ` Richard Biener
2023-10-04 12:39 ` [PATCH 02/22] Add "Condition coverage profiling" term to --help Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 03/22] Mention relevant flags in condition coverage docs Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 04/22] Describe, remove ATTRIBUTE_UNUSED from tag_conditions Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 05/22] Describe condition_info Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 06/22] Use popcount_hwi rather than builtin Jørgen Kvalsvik
2023-10-05 13:01   ` Jan Hubicka
2023-10-04 12:39 ` [PATCH 07/22] Describe add_condition_counts Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 08/22] Describe output_conditions Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 09/22] Find reachable conditions unbounded by dominators Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 10/22] Prune search for boolean expr on goto, return Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 11/22] Add test case showing cross-decision fusing Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 12/22] Do two-phase filtering in expr isolation Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 13/22] Handle split-outcome with intrusive flag Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 14/22] Unify expression candidate set refinement logic Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 15/22] Fix candidate, neighborhood set reduction phase Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 16/22] Rename pathological -> setjmp Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 17/22] Mark contracted-past nodes in reachable Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 18/22] Don't contract into random edge in multi-succ node Jørgen Kvalsvik
2023-10-04 15:29   ` Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 19/22] Beautify assert Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 20/22] Don't try to reduce NG from dominators Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 21/22] Walk the cfg in topological order, not depth-first Jørgen Kvalsvik
2023-10-04 15:24   ` Jørgen Kvalsvik
2023-10-04 12:39 ` [PATCH 22/22] Return value on separate line Jørgen Kvalsvik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).