besched: Change sched_foreach_from(sched_next(x), y) to sched_foreach_after(x, y).
[libfirm] / ir / be / bespill.h
index 7a77026..dc6b475 100644 (file)
@@ -1,30 +1,57 @@
-/**
- * Author:      Daniel Grund
- * Date:               29.09.2005
- * Copyright:   (c) Universitaet Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+/*
+ * This file is part of libFirm.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
-#ifndef BESPILL_H_
-#define BESPILL_H_
-
-#include "set.h"
-#include "pset.h"
+/**
+ * @file
+ * @brief       Option handling for spiller.
+ * @author      Matthias Braun
+ * @date        12.10.2006
+ */
+#ifndef FIRM_BE_BESPILL_H
+#define FIRM_BE_BESPILL_H
 
-#include "be_t.h"
-#include "irnode.h"
+#include "bearch.h"
 
-typedef struct _spill_env_t {
-       const be_main_session_env_t *session;
-       set *spill_ctxs;
-       pset *mem_phis;         /**< all phis which must be converted to memory phis */
-} spill_env_t;
+extern int be_coalesce_spill_slots;
+extern int be_do_remats;
 
-int be_set_cmp_spillctx(const void *a, const void *b, size_t n);
+/**
+ * An entry in the list of spill-algorithms.
+ */
+typedef struct be_spiller_t {
+       /**
+        * The spill function.
+        *
+        * @param irg   the graph to spill on
+        * @param cls   the register class to spill
+        */
+       void (*spill)(ir_graph *irg, const arch_register_class_t *cls);
+} be_spiller_t;
 
-ir_node *be_spill_node(spill_env_t *senv, ir_node *to_spill);
+/**
+ * Register a new spill algorithm.
+ *
+ * @param name     the name of the spill algorithm,
+ *                 used to select it
+ * @param spiller  a spill entry
+ */
+void be_register_spiller(const char *name, be_spiller_t *spiller);
 
-void be_remove_spilled_phis(spill_env_t *senv);
+/**
+ * Execute the selected spill algorithm
+ *
+ * @param irg   the graph to spill on
+ * @param cls   the register class to spill
+ */
+void be_do_spill(ir_graph *irg, const arch_register_class_t *cls);
 
+/**
+ * Adds additional copies, so constraints needing additional registers to be
+ * solved correctly induce the additional register pressure.
+ */
+void be_pre_spill_prepare_constr(ir_graph *irg,
+                                 const arch_register_class_t *cls);
 
-#endif /*BESPILL_H_*/
+#endif