/*
- * Project: libFIRM
- * File name: ir/ana/execution_frequency.c
- * Purpose: Compute an estimate of basic block executions.
- * Author: Goetz Lindenmaier
- * Modified by:
- * Created: 5.11.2004
- * CVS-ID: $Id$
- * Copyright: (c) 2004 Universität Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+/**
+ * @file
+ * @brief Compute an estimate of basic block executions.
+ * @author Goetz Lindenmaier
+ * @date 5.11.2004
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "firm_common_t.h"
#include "set.h"
#include "pdeq.h"
+#include "hashptr.h"
#include "irprog_t.h"
#include "irgraph_t.h"
return (ef1->reg != ef2->reg);
}
-static INLINE unsigned int exec_freq_hash(void *e) {
- unsigned int v = (unsigned int) ((reg_exec_freq *)e)->reg;
- return v ^ (v>>8);
+static INLINE unsigned int exec_freq_hash(reg_exec_freq *e) {
+ return HASH_PTR(e->reg);
}
static INLINE void set_region_exec_freq(void *reg, double freq) {
static double exception_prob = 0.001;
static INLINE int is_loop_head(ir_node *cond) {
- return false;
+ return 0;
}
/** Weight a single region in edge.