remove irg_phase_state, use IR_GRAPH_CONSTRAINT instead
[libfirm] / include / libfirm / execfreq.h
index 8b5dd16..95846f3 100644 (file)
  * @brief       Compute an estimate of basic block executions.
  * @author      Adam M. Szalkowski
  * @date        28.05.2006
- * @version     $Id$
  */
 #ifndef FIRM_ANA_EXECFREQ_H
 #define FIRM_ANA_EXECFREQ_H
 
 #include "firm_types.h"
-
-struct ir_exec_freq;
+#include "begin.h"
 
 /**
- * Create execfreq structure (to be used with set_execfreq)
+ * @ingroup irana
+ * @defgroup execfreq Basic Block Execution Frequency
+ *
+ * Execution frequencies specify how often a basic block is expected to get
+ * executed during execution of a function.
+ * For example the start block has a natural execution frequency of 1.0, the
+ * two branches of a simple if 0.5, nodes in a simple loop 10.0 ...
+ * Execution frequencies can either get estimated based on the structure of the
+ * control flow graph or can be calculated based on profile information.
+ * @{
  */
-ir_exec_freq *create_execfreq(ir_graph *irg);
 
-/**
- * Set execution frequency of a basic block
+/** Estimates execution frequency of a graph.
+ * You can query the frequencies with get_block_execfreq().
  */
-void set_execfreq(ir_exec_freq *ef, const ir_node *block, double freq);
+FIRM_API void ir_estimate_execfreq(ir_graph *irg);
 
-/**
- * Create execfreq structure and initialize with estimated frequencies
- */
-ir_exec_freq *compute_execfreq(ir_graph *irg, double loop_weight);
+/** Returns execution frequency of block @p block. */
+FIRM_API double get_block_execfreq(const ir_node *block);
 
-void free_execfreq(ir_exec_freq *ef);
+/** @} */
 
-double get_block_execfreq(const ir_exec_freq *ef, const ir_node *block);
-unsigned long get_block_execfreq_ulong(const ir_exec_freq *ef, const ir_node *block);
+#include "end.h"
 
 #endif