[ftracer] Add caching of can_duplicate_bb_p
authorTom de Vries <tdevries@suse.de>
Sun, 4 Oct 2020 10:01:34 +0000 (12:01 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 6 Oct 2020 09:23:09 +0000 (11:23 +0200)
commite6d995fddea8d5a6fb0a3bdeccf4191e652f6759
treef5b012a8117b60accc44c3b213dc6cdb811896e5
parent9d63e3ab40778a7dfd20605c8741becbb22b9014
[ftracer] Add caching of can_duplicate_bb_p

The fix "[omp, ftracer] Don't duplicate blocks in SIMT region" adds iteration
over insns in ignore_bb_p, which makes it more expensive.

Counteract this by piggybacking the computation of can_duplicate_bb_p onto
count_insns, which is called at the start of ftracer.

Bootstrapped and reg-tested on x86_64-linux.

gcc/ChangeLog:

2020-10-05  Tom de Vries  <tdevries@suse.de>

* tracer.c (count_insns): Rename to ...
(analyze_bb): ... this.
(cache_can_duplicate_bb_p, cached_can_duplicate_bb_p): New function.
(ignore_bb_p): Use cached_can_duplicate_bb_p.
(tail_duplicate): Call cache_can_duplicate_bb_p.
gcc/tracer.c