public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: "Jørgen Kvalsvik" <j@lambda.is>
Cc: gcc-patches@gcc.gnu.org, mliska@suse.cz,
	"Jørgen Kvalsvik" <jorgen.kvalsvik@woven-planet.global>,
	dmalcolm@redhat.com, rguenther@suse.de
Subject: Re: [PATCH 01/22] Add condition coverage profiling
Date: Thu, 5 Oct 2023 16:39:24 +0200	[thread overview]
Message-ID: <ZR7KnKUDK2ficN9B@kam.mff.cuni.cz> (raw)
In-Reply-To: <81555187-983a-e0bf-6e28-02d6562fbc05@lambda.is>

> On 05/10/2023 22:39, Jørgen Kvalsvik wrote:
> > On 05/10/2023 21:59, Jan Hubicka wrote:
> > > > 
> > > > Like Wahlen et al this implementation records coverage in fixed-size
> > > > bitsets which gcov knows how to interpret. This is very fast, but
> > > > introduces a limit on the number of terms in a single boolean
> > > > expression, the number of bits in a gcov_unsigned_type (which is
> > > > typedef'd to uint64_t), so for most practical purposes this would be
> > > > acceptable. This limitation is in the implementation and not the
> > > > algorithm, so support for more conditions can be added by also
> > > > introducing arbitrary-sized bitsets.
> > > 
> > > This should not be too hard to do - if conditionalis more complex you
> > > simply introduce more than one counter for it, right?
> > > How many times this trigers on GCC sources?
> > 
> > It shouldn't be, no. But when dynamic bitsets are on the table it would
> > be much better to length-encode in smaller multiples than the 64-bit
> > counters. Most expressions are small (<4 terms), so the savings would be
> > substantial. I opted for the simpler fixed-size to start with because it
> > is much simpler and would not introduce any branching or decisions in
> > the instrumentation.
> 
> Oh, and I forgot - I have never seen a real world case that have been more
> than 64 conditions, but I suppose it may happen with generated code.

reload.cc has some long hand-written conditionals in it.  The first one
I counted had 38 conditions. Some of them are macros that may expand to
sub-conditions :)

But I agree that such code should not be common and probably the
conditional should be factored to multiple predicates.

Honza

  reply	other threads:[~2023-10-05 14:39 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04 12:38 [PATCH v5] " 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZR7KnKUDK2ficN9B@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=j@lambda.is \
    --cc=jorgen.kvalsvik@woven-planet.global \
    --cc=mliska@suse.cz \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).