/* Define control flow data structures for the CFG.
- Copyright (C) 1987-2017 Free Software Foundation, Inc.
+ Copyright (C) 1987-2021 Free Software Foundation, Inc.
This file is part of GCC.
#include <profile-count.h>
/* Control flow edge information. */
-struct GTY((user)) edge_def {
+class GTY((user)) edge_def {
+public:
/* The two blocks at the ends of the edge. */
basic_block src;
basic_block dest;
int flags; /* see cfg-flags.def */
profile_probability probability;
- profile_count count; /* Expected number of executions calculated
- in profile.c */
+
+ /* Return count of edge E. */
+ inline profile_count count () const;
};
/* Masks for edge.flags. */
PTR GTY ((skip (""))) aux;
/* Innermost loop containing the block. */
- struct loop *loop_father;
+ class loop *loop_father;
/* The dominance and postdominance information node. */
struct et_node * GTY ((skip (""))) dom[2];
/* Expected number of executions: calculated in profile.c. */
profile_count count;
- /* Expected frequency. Normalized to be in range 0 to BB_FREQ_MAX. */
- int frequency;
-
/* The discriminator for this block. The discriminator distinguishes
among several basic blocks that share a common locus, allowing for
more accurate sample-based profiling. */
? EDGE_SUCC ((bb), 1) : EDGE_SUCC ((bb), 0))
/* Return expected execution frequency of the edge E. */
-#define EDGE_FREQUENCY(e) e->probability.apply (e->src->frequency)
+#define EDGE_FREQUENCY(e) e->count ().to_frequency (cfun)
/* Compute a scale factor (or probability) suitable for scaling of
gcov_type values via apply_probability() and apply_scale(). */
insns. */
#define CLEANUP_CFGLAYOUT 32 /* Do cleanup in cfglayout mode. */
#define CLEANUP_CFG_CHANGED 64 /* The caller changed the CFG. */
+#define CLEANUP_NO_PARTITIONING 128 /* Do not try to fix partitions. */
+#define CLEANUP_FORCE_FAST_DCE 0x100 /* Force run_fast_dce to be called
+ at least once. */
/* Return true if BB is in a transaction. */
return false;
}
+/* Return count of edge E. */
+inline profile_count edge_def::count () const
+{
+ return src->count.apply_probability (probability);
+}
+
#endif /* GCC_BASIC_BLOCK_H */