-/** vim: set sw=4 ts=4:
- * @file bespillremat.c
- * @date 2006-04-06
- * @author Adam M. Szalkowski & Sebastian Hack
+/*
+ * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
*
- * ILP based spilling & rematerialization
+ * This file is part of libFirm.
*
- * Copyright (C) 2006 Universitaet Karlsruhe
- * Released under the GPL
+ * 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 ILP based spilling & rematerialization
+ * @author Adam M. Szalkowski
+ * @date 06.04.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "irloop_t.h"
#include "irnodeset.h"
#include "phiclass.h"
-#include "iredges.h"
+#include "iredges_t.h"
#include "execfreq.h"
#include "irvrfy.h"
#include "irbackedge_t.h"
#include "bepressurestat.h"
#include "beprofile.h"
#include "bespilloptions.h"
-
+#include "bera.h"
#include "bechordal_t.h"
+#include "bemodule.h"
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
return result;
}
-static int
-values_interfere_in_block(const spill_ilp_t * si, const ir_node * bb, const ir_node * a, const ir_node * b)
+static
+int values_interfere_in_block(const spill_ilp_t *si, const ir_node *bb, const ir_node *a, const ir_node *b)
{
const ir_edge_t *edge;
- if(get_nodes_block(a) != bb && get_nodes_block(b) != bb) {
+ if (get_nodes_block(a) != bb && get_nodes_block(b) != bb) {
/* both values are live in, so they interfere */
return 1;
}
/* ensure a dominates b */
- if(value_dominates(b,a)) {
- const ir_node * t;
+ if (value_dominates(b, a)) {
+ const ir_node *t;
t = b;
b = a;
a = t;
/* the following code is stolen from bera.c */
- if(be_is_live_end(si->lv, bb, a))
+ if (be_is_live_end(si->lv, bb, a))
return 1;
foreach_out_edge(a, edge) {
const ir_node *user = edge->src;
- if(get_nodes_block(user) == bb
- && !is_Phi(user)
+ if (get_nodes_block(user) == bb
+ && ! is_Phi(user)
&& b != user
- && !pset_find_ptr(si->inverse_ops, user)
+ && ! pset_find_ptr(si->inverse_ops, user)
&& value_dominates(b, user))
return 1;
}