create execution frequencies from profile data
[libfirm] / ir / ana / execfreq.h
index b9abc6d..b44acb4 100644 (file)
@@ -1,18 +1,39 @@
 #ifndef EXECFREQ_H_
 #define EXECFREQ_H_
+/*
+ * Project:     libFIRM
+ * File name:   ir/ana/execfreq.h
+ * Purpose:     Compute an estimate of basic block executions.
+ * Author:      Adam M. Szalkowski
+ * Modified by:
+ * Created:     28.05.2006
+ * CVS-ID:      $Id$
+ * Copyright:   (c) 2006 Universitaet Karlsruhe
+ * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ */
+#include "firm_types.h"
 
-#include "irgraph_t.h"
-#include "irnode_t.h"
+struct _exec_freq_t;
+typedef struct _exec_freq_t exec_freq_t;
 
-typedef struct _freq_t {
-  const ir_node    *irn;
-  double            freq;
-} freq_t;
+/**
+ * Create execfreq structure (to be used with set_execfreq)
+ */
+exec_freq_t *create_execfreq(ir_graph *irg);
 
-void compute_execfreq(ir_graph * irg, double loop_weight);
+/**
+ * Set execution frequency of a basic block
+ */
+void set_execfreq(exec_freq_t *ef, const ir_node *block, double freq);
 
-void free_execfreq();
+/**
+ * Create execfreq structure and initialze with estimated frequencies
+ */
+exec_freq_t *compute_execfreq(ir_graph *irg, double loop_weight);
 
-double get_block_execfreq(const ir_node * irn);
+void free_execfreq(exec_freq_t *ef);
 
-#endif
+double get_block_execfreq(const exec_freq_t *ef, const ir_node * irn);
+unsigned long get_block_execfreq_ulong(const exec_freq_t *ef, const ir_node *bb);
+
+#endif /* EXECFREQ_H_ */