Whilst tracking down the slowdown of PR analyzer/123145, I noticed that
the various supergraph manipulations introduced in
r16-6063-g0b786d961d4426 can take non-trivial amounts of time on
complicated TUs. Add timevars to track each of them.
gcc/analyzer/ChangeLog:
PR analyzer/123145
* supergraph-fixup-locations.cc: Include "timevar.h".
(supergraph::fixup_locations): Track time spent as
TV_ANALYZER_SUPERGRAPH_FIXUP_LOCATIONS.
* supergraph-simplify.cc: Include "timevar.h".
(supergraph::simplify): Track time spent as
TV_ANALYZER_SUPERGRAPH_SIMPLIFY.
* supergraph-sorting.cc: Include "timevar.h".
(supergraph::sort_nodes): Track time spent as
TV_ANALYZER_SUPERGRAPH_SORTING.
* supergraph.cc (supergraph::supergraph): Track time spent as
TV_ANALYZER_SUPERGRAPH_CREATION rather than
TV_ANALYZER_SUPERGRAPH.
gcc/ChangeLog:
PR analyzer/123145
* timevar.def (TV_ANALYZER_SUPERGRAPH): Rename to...
(TV_ANALYZER_SUPERGRAPH_CREATION): ...this.
(TV_ANALYZER_SUPERGRAPH_FIXUP_LOCATIONS): New.
(TV_ANALYZER_SUPERGRAPH_SIMPLIFY): New.
(TV_ANALYZER_SUPERGRAPH_SORTING): New.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
#define INCLUDE_DEQUE
#include "analyzer/common.h"
+#include "timevar.h"
+
#include "analyzer/supergraph.h"
#include "analyzer/analyzer-logging.h"
#include "analyzer/supergraph-manipulation.h"
void
supergraph::fixup_locations (logger *logger)
{
+ auto_timevar tv (TV_ANALYZER_SUPERGRAPH_FIXUP_LOCATIONS);
LOG_SCOPE (logger);
location_fixer opt (*this, logger);
#include "analyzer/common.h"
#include "cgraph.h"
+#include "timevar.h"
#include "analyzer/supergraph.h"
#include "analyzer/analyzer-logging.h"
void
supergraph::simplify (logger *logger)
{
+ auto_timevar tv (TV_ANALYZER_SUPERGRAPH_SIMPLIFY);
LOG_SCOPE (logger);
{
#include "cgraph.h"
#include "alloc-pool.h"
#include "fibonacci_heap.h"
+#include "timevar.h"
#include "analyzer/supergraph.h"
#include "analyzer/analyzer-logging.h"
void
supergraph::sort_nodes (logger *logger)
{
+ auto_timevar tv (TV_ANALYZER_SUPERGRAPH_SORTING);
LOG_SCOPE (logger);
const std::vector<supernode *> ordering = get_node_ordering (*this, logger);
logger *logger)
: m_next_snode_id (0)
{
- auto_timevar tv (TV_ANALYZER_SUPERGRAPH);
-
+ auto_timevar tv (TV_ANALYZER_SUPERGRAPH_CREATION);
LOG_FUNC (logger);
/* For each BB, if present, the stmt that terminates it. */
/* Analyzer timevars. */
DEFTIMEVAR (TV_ANALYZER , "analyzer")
-DEFTIMEVAR (TV_ANALYZER_SUPERGRAPH , "analyzer: supergraph")
+DEFTIMEVAR (TV_ANALYZER_SUPERGRAPH_CREATION, "analyzer: supergraph: creation")
+DEFTIMEVAR (TV_ANALYZER_SUPERGRAPH_FIXUP_LOCATIONS, "analyzer: supergraph: fixup locations")
+DEFTIMEVAR (TV_ANALYZER_SUPERGRAPH_SIMPLIFY, "analyzer: supergraph: simplify")
+DEFTIMEVAR (TV_ANALYZER_SUPERGRAPH_SORTING, "analyzer: supergraph: sorting")
DEFTIMEVAR (TV_ANALYZER_STATE_PURGE , "analyzer: state purge")
DEFTIMEVAR (TV_ANALYZER_PLAN , "analyzer: planning")
DEFTIMEVAR (TV_ANALYZER_SCC , "analyzer: scc")