unified .h #ifndef ... #define ...
changed some indenting
removed some unused code
removed beuses_t.h as unused header
[r13559]
#include "irtools.h"
#include "debug.h"
#include "xmalloc.h"
+#include "iredges.h"
#include "beutil.h"
#include "besched.h"
#include "debug.h"
#include "xmalloc.h"
#include "execfreq.h"
+#include "iredges_t.h"
#include "bechordal_t.h"
#include "beabi.h"
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 12.03.2007
- * Copyright: (c) Universitaet Karlsruhe
- * License: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Interface for assembler output.
+ * @author Matthias Braun
+ * @date 12.03.2007
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 12.03.2007
- * Copyright: (c) Universitaet Karlsruhe
- * License: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Interface for assembler output.
+ * @author Matthias Braun
+ * @date 12.03.2007
+ * @version $Id$
*/
#ifndef FIRM_BE_BEEMITTER_H
#define FIRM_BE_BEEMITTER_H
*/
/**
- * Dumps global variables and constants as gas assembler.
- * @author Christian Wuerdig, Matthias Braun
- * @date 04.11.2005
- * @version $Id$
+ * @file
+ * @brief Dumps global variables and constants as gas assembler.
+ * @author Christian Wuerdig, Matthias Braun
+ * @date 04.11.2005
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
- * Header for ia32 assembler declarations dumper.
- * @author Christian Wuerdig, Matthias Braun
- * $Id$
+ * @file
+ * @brief Dumps global variables and constants as gas assembler.
+ * @author Christian Wuerdig, Matthias Braun
+ * @date 04.11.2005
+ * @version $Id$
*/
-#ifndef _BE_GEN_DECLS_H_
-#define _BE_GEN_DECLS_H_
+#ifndef FIRM_BE_BEGNUAS_H
+#define FIRM_BE_BEGNUAS_H
#include "be.h"
#include "beemitter.h"
void be_gas_emit_switch_section(be_emit_env_t *env, be_gas_section_t section);
-#endif
+#endif /* FIRM_BE_BEGNUAS_H */
*/
/**
- * @file beifg.c
- * @date 18.11.2005
- * @author Sebastian Hack
- *
- * Copyright (C) 2005 Universitaet Karlsruhe
- * Released under the GPL
+ * @file
+ * @brief Interface for interference graphs.
+ * @author Sebastian Hack
+ * @date 18.11.2005
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
- * @file beifg.h
- * @date 18.11.2005
- * @author Sebastian Hack
- *
- * Copyright (C) 2005 Universitaet Karlsruhe
- * Released under the GPL
+ * @file
+ * @brief Interface for interference graphs.
+ * @author Sebastian Hack
+ * @date 18.11.2005
+ * @version $Id$
*/
-
-#ifndef _BEIFG_H
-#define _BEIFG_H
+#ifndef FIRM_BE_BEIFG_H
+#define FIRM_BE_BEIFG_H
#include <stdio.h>
void be_ifg_check_performance(be_chordal_env_t *chordal_env);
-#endif /* _BEIFG_H */
+#endif /* FIRM_BE_BEIFG_H */
#include "benodesets.h"
typedef struct _cli_head_t {
- struct list_head list;
+ struct list_head list;
struct _cli_head_t *next_cli_head;
- ir_node *min;
- ir_node *max;
+ ir_node *min;
+ ir_node *max;
} cli_head_t;
typedef struct _ifg_clique_t {
- const be_ifg_impl_t *impl;
+ const be_ifg_impl_t *impl;
const be_chordal_env_t *env;
- cli_head_t *cli_root;
- struct obstack obst;
- cli_head_t *curr_cli_head;
+ cli_head_t *cli_root;
+ struct obstack obst;
+ cli_head_t *curr_cli_head;
} ifg_clique_t;
typedef struct _cli_element_t {
struct list_head list;
- ir_node *irn;
+ ir_node *irn;
} cli_element_t;
typedef struct _cli_iter_t {
const ifg_clique_t *ifg;
- cli_head_t *curr_cli_head;
- cli_element_t *curr_cli_element;
- const ir_node *curr_irn;
- bitset_t *visited_neighbours;
- bitset_t *visited_nodes;
+ cli_head_t *curr_cli_head;
+ cli_element_t *curr_cli_element;
+ const ir_node *curr_irn;
+ bitset_t *visited_neighbours;
+ bitset_t *visited_nodes;
} cli_iter_t;
/* PRIVATE FUNCTIONS */
if (&element->list != &head->list)
{
if (element->irn == irn)
- { /* node is in clique */
+ {
+ /* node is in clique */
it->curr_cli_head = head;
- it->curr_cli_element = (void *) head; /* needed because the next element is searched with list.next of it->curr_cli_element */
+ /* needed because the next element is searched with list.next of it->curr_cli_element */
+ it->curr_cli_element = (void *) head;
break;
}
}
return head;
}
-static cli_element_t *get_next_element(const ir_node *irn, cli_iter_t *it) /* ... of the current clique, returns NULL if there were no more elements ..*/
+/* ... of the current clique, returns NULL if there were no more elements ..*/
+static cli_element_t *get_next_element(const ir_node *irn, cli_iter_t *it)
{
cli_element_t *element = it->curr_cli_element;
- cli_head_t *head = it->curr_cli_head;
+ cli_head_t *head = it->curr_cli_head;
if (!head || it->curr_cli_element == NULL) /* way back of recursion or there are no more heads */
{
static void find_first_neighbour(const ifg_clique_t *ifg, cli_iter_t *it, const ir_node *irn)
{
- cli_head_t *cli_head = ifg->cli_root;
+ cli_head_t *cli_head = ifg->cli_root;
cli_element_t *element;
- bitset_t *bitset_visneighbours = bitset_malloc(get_irg_last_idx(ifg->env->irg));
+ bitset_t *bitset_visneighbours = bitset_malloc(get_irg_last_idx(ifg->env->irg));
int is_dominated_by_max = 0;
int dominates_min = 0;
*/
/**
- * @file beifg_impl.h
- * @date 01.12.2005
- * @author Sebastian Hack
- *
- * Copyright (C) 2005 Universitaet Karlsruhe
- * Released under the GPL
- *
- * Constructors for different implementations of
- * chordal interference graphs.
+ * @file
+ * @brief Constructors for different implementations of chordal interference graphs.
+ * @author Sebastian Hack
+ * @date 01.12.2005
+ * @version $Id$
*/
+#ifndef FIRM_BE_BEIFG_IMPL_H
+#define FIRM_BE_BEIFG_IMPL_H
-#ifndef _BEIFG_IMPL_H
-#define _BEIFG_IMPL_H
-
-#include "bechordal_t.h"
+#include "beifg.h"
+#include "bechordal.h"
be_ifg_t *be_ifg_std_new(const be_chordal_env_t *env);
be_ifg_t *be_ifg_list_new(const be_chordal_env_t *env);
be_ifg_t *be_ifg_clique_new(const be_chordal_env_t *env);
be_ifg_t *be_ifg_pointer_new(const be_chordal_env_t *env);
-#endif /* _BEIFG_IMPL_H */
+#endif /* FIRM_BE_BEIFG_IMPL_H */
*/
/**
- * @file beifg_list.c
- * @date 18.11.2005
- * @author Sebastian Hack
- *
- * Copyright (C) 2005 Universitaet Karlsruhe
- * Released under the GPL
+ * @file
+ * @brief List based implementation of chordal interference graphs.
+ * @author Sebastian Hack
+ * @date 18.11.2005
+ * @version $Id$
*/
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
typedef struct _adj_head_t adj_head_t;
typedef struct _ifg_list_t {
- const be_ifg_impl_t *impl;
+ const be_ifg_impl_t *impl;
const be_chordal_env_t *env;
- struct obstack obst;
- adj_head_t **adj_heads;
+ struct obstack obst;
+ adj_head_t **adj_heads;
} ifg_list_t;
typedef struct _adj_element_t adj_element_t;
struct _adj_element_t {
adj_element_t *next_adj_element;
- ir_node *neighbour;
+ ir_node *neighbour;
};
struct _adj_head_t {
- ir_node *irn; /* the node you search neighbours for */
+ ir_node *irn; /* the node you search neighbours for */
adj_element_t *first_adj_element;
- int degree;
+ int degree;
};
typedef struct _nodes_iter_t {
const ifg_list_t *ifg;
- unsigned int curr_node_idx;
+ unsigned int curr_node_idx;
} nodes_iter_t;
typedef struct _adj_iter_t {
const ifg_list_t *ifg;
- adj_element_t *curr_adj_element;
+ adj_element_t *curr_adj_element;
} adj_iter_t;
/* PRIVATE FUNCTIONS */
-static void create_node (ifg_list_t *ifg, ir_node *irn) /* add node to the array of all nodes in this ifg implementation, if the node isn't already in the ifg */
+/* add node to the array of all nodes in this ifg implementation, if the node isn't already in the ifg */
+static void create_node(ifg_list_t *ifg, ir_node *irn)
{
adj_head_t *adj_head = NULL;
return element;
}
-static void add_edge(ifg_list_t *ifg, ir_node *node_a, ir_node *node_b) /* write the information about the edge between a and b */
+/* write the information about the edge between a and b */
+static void add_edge(ifg_list_t *ifg, ir_node *node_a, ir_node *node_b)
{
- adj_head_t *adj_head = NULL;
+ adj_head_t *adj_head = NULL;
adj_element_t *curr_element = NULL;
- adj_element_t *new_element = NULL;
+ adj_element_t *new_element = NULL;
adj_head = ifg->adj_heads[node_a->node_idx]; /* find the neighbours list of a */
}
}
-static void find_neighbour_walker(ir_node *bl, void *data) /* find all adjacent nodes in the irg */
+/* find all adjacent nodes in the irg */
+static void find_neighbour_walker(ir_node *bl, void *data)
{
- ifg_list_t *ifg = data;
- struct list_head *head = get_block_border_head(ifg->env, bl);
+ ifg_list_t *ifg = data;
+ struct list_head *head = get_block_border_head(ifg->env, bl);
+ nodeset *live = new_nodeset(ifg->env->cls->n_regs);
+ ir_node *live_irn = NULL;
+ border_t *b = NULL;
- nodeset *live = new_nodeset(ifg->env->cls->n_regs);
- ir_node *live_irn = NULL;
- border_t *b = NULL;
-
- assert (is_Block(bl) && "There is no block to work on");
+ assert(is_Block(bl) && "There is no block to work on");
foreach_border_head(head, b) /* follow the borders of each block */
{
static ir_node *get_first_node(const ifg_list_t *ifg, nodes_iter_t *it)
{
- ir_node *res = NULL;
- adj_head_t *adj_head= NULL;
- int curr_idx = -1;
+ ir_node *res = NULL;
+ adj_head_t *adj_head = NULL;
+ int curr_idx = -1;
it->ifg = ifg;
it->curr_node_idx = 0;
static ir_node *get_next_node(nodes_iter_t *it)
{
- const ifg_list_t *ifg = it->ifg;
- ir_node *res = NULL;
- adj_head_t *adj_head= NULL;
- unsigned int curr_idx = it->curr_node_idx;
+ const ifg_list_t *ifg = it->ifg;
+ ir_node *res = NULL;
+ adj_head_t *adj_head = NULL;
+ unsigned int curr_idx = it->curr_node_idx;
while (adj_head == NULL && curr_idx < it->ifg->env->irg->last_node_idx - 1)
{
static ir_node *get_first_neighbour(const ifg_list_t *ifg, adj_iter_t *it, const ir_node *curr_irn)
{
- ir_node *res = NULL;
+ ir_node *res = NULL;
adj_head_t *adj_head = NULL;
adj_head = ifg->adj_heads[curr_irn->node_idx];
- assert (adj_head && "There is no entry for this node");
+ assert(adj_head && "There is no entry for this node");
it->curr_adj_element = NULL;
it->ifg = ifg;
static ir_node *get_next_neighbour(adj_iter_t *it)
{
- ir_node *res = NULL;
+ ir_node *res = NULL;
adj_element_t *element = it->curr_adj_element;
if (element->next_adj_element) /* return next neighbour */
static int ifg_list_connected(const void *self, const ir_node *a, const ir_node *b)
{
- const ifg_list_t *ifg = self;
- int res = -1;
- adj_head_t *adj_head = NULL;
- adj_element_t *curr_element = NULL;
+ const ifg_list_t *ifg = self;
+ int res = -1;
+ adj_head_t *adj_head = NULL;
+ adj_element_t *curr_element = NULL;
/* first try: find b in the neigbours of a */
adj_head = ifg->adj_heads[a->node_idx];
assert(adj_head && "There is no entry for the node a");
curr_element = adj_head->first_adj_element;
- if(curr_element)
+ if (curr_element)
{
while (curr_element->neighbour != b && curr_element->next_adj_element)
{
assert(adj_head && "There is no entry for the node b");
curr_element = adj_head->first_adj_element;
- if(curr_element)
+ if (curr_element)
{
while (curr_element->neighbour != a && curr_element->next_adj_element)
{
*/
/**
- * @file beifg_pointer.c
- * @date 18.11.2005
- * @author Sebastian Hack
- *
- * Copyright (C) 2005 Universitaet Karlsruhe
- * Released under the GPL
+ * @file
+ * @brief Pointer based implementation of chordal interference graphs.
+ * @author Sebastian Hack
+ * @date 18.11.2005
+ * @version $Id$
*/
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
typedef struct _ptr_element_t ptr_element_t;
typedef union element_content {
- ir_node *irn;
+ ir_node *irn;
ptr_element_t *element;
} element_content;
typedef struct _ptr_head_t {
struct list_head list;
- ptr_element_t *element;
+ ptr_element_t *element;
} ptr_head_t;
typedef struct _ifg_pointer_t {
- const be_ifg_impl_t *impl;
+ const be_ifg_impl_t *impl;
const be_chordal_env_t *env;
- ir_phase ph;
- struct obstack obst;
- ptr_head_t *curr_ptr_head;
- ptr_element_t *curr_element;
- pmap *node_map;
+ ir_phase ph;
+ struct obstack obst;
+ ptr_head_t *curr_ptr_head;
+ ptr_element_t *curr_element;
} ifg_pointer_t;
typedef struct _ptr_iter_t {
const ifg_pointer_t *ifg;
- const ir_node *irn;
- ptr_head_t *curr_ptr_head;
- ptr_head_t *first_head;
- ptr_element_t *curr_element_t;
- ir_node *curr_irn;
- int get_first;
- int sub_call;
- bitset_t *visited_neighbours;
+ const ir_node *irn;
+ ptr_head_t *curr_ptr_head;
+ ptr_head_t *first_head;
+ ptr_element_t *curr_element_t;
+ ir_node *curr_irn;
+ int get_first;
+ int sub_call;
+ bitset_t *visited_neighbours;
} ptr_iter_t;
/* PRIVATE FUNCTIONS */
static void write_pointers(bitset_t *live, ifg_pointer_t *ifg)
{
- ir_node *live_irn;
+ ir_node *live_irn;
bitset_pos_t elm;
bitset_foreach_irn(ifg->env->irg, live, elm, live_irn)
{
- ptr_head_t *head = phase_get_or_set_irn_data(&ifg->ph, live_irn);
+ ptr_head_t *head = phase_get_or_set_irn_data(&ifg->ph, live_irn);
ptr_head_t *element = ptr_get_new_head(ifg);
- ir_node *irn = NULL;
-
-#if 0
- // Matze: huh, what is this?!? node numbers aren't in any way deterministic AFAIK
- if (live_irn->node_nr == 1883 || live_irn->node_nr == 1858)
- irn = NULL;
-#endif
element->element = ifg->curr_element; /* write current highest sub-clique for each node */
list_add(&element->list, &head->list);
-
- /* the following code is to find all nodes, it should be replaced by a "keywalker" of irphase */
- irn = pmap_get(ifg->node_map, live_irn);
- if (!irn)
- pmap_insert(ifg->node_map, live_irn, live_irn);
}
}
static void find_neighbour_walker(ir_node *bl, void *data)
{
- ifg_pointer_t *ifg = data;
- struct list_head *head = get_block_border_head(ifg->env, bl);
- border_t *b;
- bitset_t *live = bitset_malloc(get_irg_last_idx(ifg->env->irg));
- bitset_t *my_live;
- bitset_pos_t my_elm;
- ir_node *my_irn;
- element_content last_irn;
- element_content last_element;
- int was_def = 0;
- ir_node *first = NULL;
- int was_first = 0;
-
- last_irn.irn = NULL;
+ ifg_pointer_t *ifg = data;
+ struct list_head *head = get_block_border_head(ifg->env, bl);
+ int was_def = 0;
+ int was_first = 0;
+ ir_node *first = NULL;
+ bitset_t *live = bitset_malloc(get_irg_last_idx(ifg->env->irg));
+ bitset_t *my_live;
+ bitset_pos_t my_elm;
+ border_t *b;
+ ir_node *my_irn;
+ element_content last_irn;
+ element_content last_element;
+
+ last_irn.irn = NULL;
last_element.element = NULL;
assert(is_Block(bl) && "There is no block to work on.");
foreach_border_head(head, b) /* follow the borders of the block */
{
- ir_node *irn = b->irn;
+ ir_node *irn = b->irn;
ptr_element_t *element = NULL;
-#if 0
- // ?!?
- if (irn->node_nr == 1883 || irn->node_nr == 1858)
- i=1;
-#endif
-
if (b->is_def) /* b is a new node */
{
bitset_set(live, get_irn_idx(irn));
element->content_second.irn = b->irn;
element->kind = 8888; /* both are ir_nodes */
-#if 0
- // ?!?
- if (irn->node_nr == 1883 || irn->node_nr == 1858 || irn->node_nr == 1936)
- i=1;
-#endif
-
-
last_element.element = element;
- ifg->curr_element = element;
- last_irn.irn = NULL;
+ ifg->curr_element = element;
+ last_irn.irn = NULL;
}
else
{
last_element.element = get_last_sub_clique(ifg, live, my_live, irn);
/* check and add still living nodes */
- //bitset_remv_irn(my_live, irn);
if (bitset_popcnt(my_live) > 1)
{
if (last_element.element)
my_element->kind = 8888; /* both are ir_nodes */
last_element.element = my_element;
ifg->curr_element = my_element;
-
-#if 0
- // ?!?
- if (my_irn->node_nr == 1883 || my_irn->node_nr == 1858 || my_irn->node_nr == 1936)
- i=1;
-#endif
-
-
first = NULL;
}
else
static ir_node *get_first_irn(const ifg_pointer_t *ifg, ptr_iter_t *it)
{
- /* this should be replaced using a keywalker of the irphase &ifg.ph */
- ir_node *irn;
- pmap_entry *entry;
-
- it->ifg = ifg;
- entry = pmap_first(ifg->node_map);
+ ir_node *irn = phase_get_first_node(&ifg->ph);
- if (!entry)
+ if (! irn)
return NULL;
- irn = entry->value;
it->curr_irn = irn;
return irn;
static ir_node *get_next_irn(ptr_iter_t *it)
{
- /* this should be replaced using a keywalker of the irphase &ifg.ph */
- ir_node *irn;
- pmap_entry *entry;
-
- irn = it->curr_irn;
- entry = pmap_next(it->ifg->node_map);
+ ir_node *irn = phase_get_next_node(&it->ifg->ph, it->curr_irn);
- if (!entry)
+ if (! irn)
return NULL;
- it->curr_irn = entry->value;
+ it->curr_irn = irn;
- return entry->value;
+ return irn;
}
static ir_node *get_next_neighbour(ptr_iter_t *it)
{
- ir_node *res;
- ptr_head_t *head;
+ ir_node *res;
+ ptr_head_t *head;
ptr_element_t *element;
element = it->curr_element_t;
if (element == NULL)
{
-#if 0
- // ?!?
- if (it->irn->node_nr == 1883 || it->irn->node_nr == 1858)
- i=1;
-#endif
-
if (it->curr_ptr_head->list.next != &it->first_head->list)
{
head = list_entry(it->curr_ptr_head->list.next, ptr_head_t, list);
static ir_node *get_first_neighbour(const ifg_pointer_t *ifg, ptr_iter_t *it, const ir_node *irn)
{
- ir_node *res;
- ptr_head_t *head;
+ ir_node *res;
+ ptr_head_t *head;
ptr_element_t *element;
- bitset_t *bitsetvisited_neighbours = bitset_malloc(get_irg_last_idx(ifg->env->irg));
+ bitset_t *bitsetvisited_neighbours = bitset_malloc(get_irg_last_idx(ifg->env->irg));
- it->ifg = ifg;
- it->irn = irn;
+ it->ifg = ifg;
+ it->irn = irn;
it->get_first = 0;
- it->sub_call = 0;
+ it->sub_call = 0;
it->visited_neighbours = bitsetvisited_neighbours;
head = phase_get_irn_data(&ifg->ph, irn);
- if (!head)
+ if (! head)
return NULL;
else
{
static int ifg_pointer_connected(const void *self, const ir_node *a, const ir_node *b)
{
const ifg_pointer_t *ifg = self;
- int connected = -1;
- ptr_iter_t it;
- ir_node *irn = NULL;
+ int connected = -1;
+ ptr_iter_t it;
+ ir_node *irn = NULL;
- irn = get_first_neighbour(ifg, &it, a);
+ irn = get_first_neighbour(ifg, &it, a);
connected = 0;
while (irn != NULL)
{
ifg->impl = &ifg_pointer_impl;
ifg->env = env;
- ifg->node_map = pmap_create(); /* to find all nodes, should be replaced by a "keywalker" of irphase */
-
phase_init(&ifg->ph, "ptr_map", env->irg, PHASE_DEFAULT_GROWTH, ptr_irn_data_init, NULL);
obstack_init(&ifg->obst);
*/
/**
- * Common use interference graph.
+ * @file
+ * @brief Common use interference graph.
+ * @author Sebastian Hack
+ * @date 27.06.2005
+ * @version $Id$
+ *
* Originally written by Sebastian Hack. Refactored into a seperate
* source file and header by Kimon Hoffmann.
- * @author Sebastian Hack
- * @date 27.06.2005
*/
-#ifndef _BEIFG_T_H_
-#define _BEIFG_T_H_
+#ifndef FIRM_BE_BEIFG_T_H
+#define FIRM_BE_BEIFG_T_H
#include "beifg.h"
#define be_ifg_cliques_break(self, iter) ((self)->impl->cliques_break(self, iter))
#define be_ifg_degree(self,irn) ((self)->impl->degree(self, irn))
-#endif
+#endif /* _BE_IFG_USE_MACROS */
void be_ifg_check(const be_ifg_t *ifg);
-#endif /*_BEIFG_T_H_*/
+#endif /* FIRM_BE_BEIFG_T_H */
* PURPOSE.
*/
-#ifndef _BEILPSCHED_H_
-#define _BEILPSCHED_H_
-
-#include "firm_config.h"
+/**
+ * @file
+ * @brief ILP based instruction scheduling.
+ * @author Christian Wuerdig
+ * @date 22.10.2006
+ * @version $Id$
+ *
+ * An ILP scheduler based on
+ * "ILP-based Instruction Scheduling for IA-64"
+ * by Daniel Kaestner and Sebastian Winkel
+ * extended with register pressure constraints by Christian Wuerdig
+ */
+#ifndef FIRM_BE_BEILPSCHED_H
+#define FIRM_BE_BEILPSCHED_H
-#include "bemachine.h"
-#include "beirg.h"
+#include "irgraph.h"
+#include "irnode.h"
typedef struct _ilp_sched_selector_t ilp_sched_selector_t;
typedef struct _ilp_sched_selector_if_t ilp_sched_selector_if_t;
*/
void be_ilp_sched(const be_irg_t *birg, be_options_t *be_opts);
-#endif /* _BEILPSCHED_H_ */
+#endif /* FIRM_BE_BEILPSCHED_H */
* PURPOSE.
*/
+/**
+ * @file
+ * @brief A data structure to treat nodes and node-proj collections uniformly.
+ * @author Sebastian Hack
+ * @version $Id$
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
*/
/**
- * Instructions
- *
- * A data structure to treat nodes and node-proj collections uniformly.
+ * @file
+ * @brief A data structure to treat nodes and node-proj collections uniformly.
+ * @author Sebastian Hack
+ * @version $Id$
*/
+#ifndef FIRM_BE_BEINSN_T_H
+#define FIRM_BE_BEINSN_T_H
-#ifndef _BEINSN_T_H
-#define _BEINSN_T_H
-
+#include "irnode.h"
#include "bitset.h"
+#include "obst.h"
-#include "bearch_t.h"
+#include "bearch.h"
+#include "beirg.h"
typedef struct _be_operand_t be_operand_t;
typedef struct _be_insn_t be_insn_t;
be_insn_env_t *be_insn_env_init(be_insn_env_t *ie, const be_irg_t *birg, const arch_register_class_t *cls, struct obstack *obst);
-#endif /* _BEINSN_T_H */
+#endif /* FIRM_BE_BEINSN_T_H */
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 13.12.2006
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Backend irg - a ir_graph with additional analysis information.
+ * @author Matthias Braun
+ * @date 13.12.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
void be_assure_liveness(be_irg_t *birg)
{
- if(birg->lv != NULL)
+ if (birg->lv != NULL)
return;
birg->lv = be_liveness(birg->irg);
void be_invalidate_liveness(be_irg_t *birg)
{
- if(birg->lv == NULL)
+ if (birg->lv == NULL)
return;
be_liveness_free(birg->lv);
void be_assure_dom_front(be_irg_t *birg)
{
- if(birg->dom_front != NULL)
+ if (birg->dom_front != NULL)
return;
birg->dom_front = be_compute_dominance_frontiers(birg->irg);
void be_invalidate_dom_front(be_irg_t *birg)
{
- if(birg->dom_front == NULL)
+ if (birg->dom_front == NULL)
return;
be_free_dominance_frontiers(birg->dom_front);
free_execfreq(birg->exec_freq);
birg->exec_freq = NULL;
- if(birg->dom_front != NULL) {
+ if (birg->dom_front != NULL) {
be_free_dominance_frontiers(birg->dom_front);
birg->dom_front = NULL;
}
- if(birg->lv != NULL) {
+ if (birg->lv != NULL) {
be_liveness_free(birg->lv);
birg->lv = NULL;
}
}
-ir_graph* (be_get_birg_irg) (const be_irg_t *birg)
+ir_graph *(be_get_birg_irg)(const be_irg_t *birg)
{
return _be_get_birg_irg(birg);
}
-ir_exec_freq* (be_get_birg_exec_freq) (const be_irg_t *birg)
+ir_exec_freq *(be_get_birg_exec_freq)(const be_irg_t *birg)
{
return _be_get_birg_exec_freq(birg);
}
-be_lv_t* (be_get_birg_liveness) (const be_irg_t *birg)
+be_lv_t *(be_get_birg_liveness)(const be_irg_t *birg)
{
return _be_get_birg_liveness(birg);
}
-be_dom_front_info_t* (be_get_birg_dom_front) (const be_irg_t *birg)
+be_dom_front_info_t *(be_get_birg_dom_front)(const be_irg_t *birg)
{
return _be_get_birg_dom_front(birg);
}
-const arch_env_t* (be_get_birg_arch_env) (const be_irg_t *birg)
+const arch_env_t *(be_get_birg_arch_env)(const be_irg_t *birg)
{
return _be_get_birg_arch_env(birg);
}
*/
/**
- * Author: Matthias Braun
- * Date: 05.05.2006
- * Copyright: (c) Universitaet Karlsruhe
- * License: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
- *
- * Backend irg - a ir_graph with additional analysis information
+ * @file
+ * @brief Backend irg - a ir_graph with additional analysis information.
+ * @author Matthias Braun
+ * @date 05.05.2006
+ * @version $Id$
*/
-#ifndef BEIRG_H
-#define BEIRG_H
+#ifndef FIRM_BE_BEIRG_H
+#define FIRM_BE_BEIRG_H
+#include "execfreq.h"
#include "belive.h"
#include "bedomfront.h"
*/
void be_free_birg(be_irg_t *birg);
-#endif
+#endif /* FIRM_BE_BEIRG_H */
*/
/**
- * Author: Matthias Braun
- * Date: 05.05.2006
- * Copyright: (c) Universitaet Karlsruhe
- * License: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
- *
- * Backend irg - a ir_graph with additional analysis information
+ * @file
+ * @brief Backend irg - a ir_graph with additional analysis information.
+ * @author Matthias Braun
+ * @date 05.05.2006
+ * @version $Id$
*/
-#ifndef BEIRG_T_H
-#define BEIRG_T_H
+#ifndef FIRM_BE_BEIRG_T_H
+#define FIRM_BE_BEIRG_T_H
#include "beirg.h"
#include "be_t.h"
#define be_get_birg_dom_front(birg) _be_get_birg_dom_front(birg)
#define be_get_birg_irg(birg) _be_get_birg_irg(birg)
-#endif
+#endif /* FIRM_BE_BEIRG_T_H */
/**
* @file
- * @brief
+ * @brief Backend IRG modification routines.
+ * @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
+ * @date 04.05.2005
+ * @version $Id$
+ *
* This file contains the following IRG modifications for be routines:
* - insertion of Perm nodes
* - empty block elimination
* - a simple dead node elimination (set inputs of unreachable nodes to BAD)
- *
- * @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
- * @date 04.05.2005
- * @version $Id$
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
-#ifndef _FIRM_BE_IRGMOD_H_
-#define _FIRM_BE_IRGMOD_H_
+#ifndef FIRM_BE_BEIRGMOD_H
+#define FIRM_BE_BEIRGMOD_H
#include "irnode.h"
#include "beirg.h"
*/
int be_remove_empty_blocks(ir_graph *irg);
-#endif /* _BEIRGMOD_H */
+#endif /* FIRM_BE_BEIRGMOD_H */
* PURPOSE.
*/
-
+/**
+ * @file
+ * @brief Interface for external Java coalescer.
+ * @author Sebastian Hack
+ * @version $Id$
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
return path;
}
-#else
+#else /* ! _WIN32 */
/* Unix version */
static void *find_jvm_symbol(const char *vmlibpath, const char *sym)
{
{
return NULL;
}
-#endif
+#endif /* _WIN32 */
static int start_vm(jni_env_t *env, int argc, char *argv[])
{
CHECK(c->env);
(*jni)->CallVoidMethod(jni, c->obj, mid, (jint) n, str);
CHECK(c->env);
-#endif
+#endif /* if 0 */
}
void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col)
get_jvm();
}
-#else
+#else /* ! WITH_JVM */
be_java_coal_t *be_java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level)
{
* PURPOSE.
*/
-
-#ifndef _BEJAVACOAL_H
-#define _BEJAVACOAL_H
+/**
+ * @file
+ * @brief Interface for external Java coalescer.
+ * @author Sebastian Hack
+ * @version $Id$
+ */
+#ifndef FIRM_BE_BEJAVACOAL_H
+#define FIRM_BE_BEJAVACOAL_H
struct _be_java_coal_t;
typedef struct _be_java_coal_t be_java_coal_t;
*/
void be_java_coal_destroy(be_java_coal_t *c);
-#endif
+#endif /* FIRM_BE_BEJAVACOAL_H */
*/
/**
- * Scheduling algorithms.
- * Just a simple list scheduling algorithm is here.
- * @date 20.10.2004
- * @author Sebastian Hack
- * @version $Id$
+ * @file
+ * @brief Primitive list scheduling with different node selectors.
+ * @author Sebastian Hack
+ * @date 20.10.2004
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
- * Primitive list scheduling.
- * @date 20.10.2004
- * @author Sebastian Hack
+ * @file
+ * @brief Primitive list scheduling with different node selectors.
+ * @author Sebastian Hack
+ * @date 20.10.2004
+ * @version $Id$
*/
-#ifndef _FIRM_LIST_SCHED
-#define _FIRM_LIST_SCHED
-
-#include "firm_config.h"
-
-#include "firm_types.h"
+#ifndef FIRM_BE_BELISTSCHED_H
+#define FIRM_BE_BELISTSCHED_H
+#include "irgraph.h"
+#include "irnode.h"
#include "irnodeset.h"
-#include "bearch_t.h"
+
#include "be.h"
+#include "bearch.h"
#include "beirg.h"
typedef struct _list_sched_selector_t list_sched_selector_t;
*/
void list_sched_single_block(const be_irg_t *birg, ir_node *block, be_options_t *be_opts);
-#endif /* _FIRM_LIST_SCHED */
+#endif /* FIRM_BE_BELISTSCHED_H */
*/
/**
- * Interblock liveness analysis.
- * @author Sebastian Hack
- * @date 6.12.2004
+ * @file
+ * @brief Interblock liveness analysis.
+ * @author Sebastian Hack
+ * @date 06.12.2004
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
- * Interblock liveness analysis.
- * @author Sebastian Hack
- * @date 6.12.2004
- * @cvs-id $Id$
+ * @file
+ * @brief Interblock liveness analysis.
+ * @author Sebastian Hack
+ * @date 06.12.2004
+ * @version $Id$
*/
-#ifndef FIRM_BELIVE_H
-#define FIRM_BELIVE_H
+#ifndef FIRM_BE_BELIVE_H
+#define FIRM_BE_BELIVE_H
+
+#include <stdio.h>
-#include "firm_types.h"
#include "pset.h"
-#include "bearch.h"
+#include "irnode.h"
+#include "irgraph.h"
-#include <stdio.h>
+#include "bearch.h"
typedef enum {
be_lv_state_in = 1,
typedef struct _be_lv_info_t be_lv_info_t;
-
/**
* Compute the inter block liveness for a graph.
* @param irg The graph.
*/
pset *be_liveness_nodes_live_at_input(const be_lv_t *lv, const arch_env_t *arch_env, const arch_register_class_t *cls, const ir_node *pos, pset *live);
-
-/**
- * FIXME: Need comment
- */
-void be_liveness_add_missing(be_lv_t *lv);
-
-#endif /* _BELIVE_H */
+#endif /* FIRM_BE_BELIVE_H */
*/
/**
- * Internal headers for liveness analysis.
- * @author Sebastian Hack
- * @date 6.12.2004
+ * @file
+ * @brief Internal headers for liveness analysis.
+ * @author Sebastian Hack
+ * @date 06.12.2004
+ * @version $Id$
*/
-
-#ifndef _BELIVE_T_H
-#define _BELIVE_T_H
+#ifndef FIRM_BE_BELIVE_T_H
+#define FIRM_BE_BELIVE_T_H
#include "irgraph_t.h"
-#include "iredges_t.h"
#include "irphase_t.h"
#include "irhooks.h"
#include "pset.h"
-#include "set.h"
-#include "list.h"
-#include "hashptr.h"
#include "bitset.h"
#include "belive.h"
static INLINE int _be_lv_next_irn(const struct _be_lv_t *lv, const ir_node *bl, unsigned flags, int i)
{
- struct _be_lv_info_t *arr = phase_get_irn_data(&lv->ph, bl);
- if(arr) {
+ struct _be_lv_info_t *arr = phase_get_irn_data(&lv->ph, bl);
+
+ if (arr) {
int n_members = (int) arr[0].u.head.n_members;
while(i < n_members) {
return -1;
}
-static INLINE ir_node * _be_lv_get_irn(const struct _be_lv_t *lv, const ir_node *bl, int i)
+static INLINE ir_node *_be_lv_get_irn(const struct _be_lv_t *lv, const ir_node *bl, int i)
{
- struct _be_lv_info_t *arr = phase_get_irn_data(&lv->ph, bl);
+ struct _be_lv_info_t *arr = phase_get_irn_data(&lv->ph, bl);
return get_idx_irn(lv->irg, arr[i + 1].u.node.idx);
}
}
#define be_lv_foreach(lv, bl, flags, i) \
- for(i = _be_lv_next_irn(lv, bl, flags, 0); i >= 0; i = _be_lv_next_irn(lv, bl, flags, i + 1))
+ for (i = _be_lv_next_irn(lv, bl, flags, 0); i >= 0; i = _be_lv_next_irn(lv, bl, flags, i + 1))
static INLINE pset *_be_lv_pset_put(const struct _be_lv_t *lv, const ir_node *block, int state, pset *s)
#define be_lv_has_info_about(lv, irn) bitset_is_set((lv)->nodes, get_irn_idx(irn))
-#endif
+#endif /* FIRM_BE_BELIVE_T_H */
*/
/**
- * Author: Christian Wuerdig
- * Date: 2007/02/19
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
- * CVS-Id: $Id$
- *
- * Compute register pressure in loops
+ * @file
+ * @brief Compute register pressure in loops.
+ * @author Christian Wuerdig
+ * @date 19.02.2007
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
- * Analyse register pressure in loops.
- * @author Christian Wuerdig
- * @date 2006/02/20
- * @cvsid $Id$
+ * @file
+ * @brief Compute register pressure in loops.
+ * @author Christian Wuerdig
+ * @date 20.02.2007
+ * @version $Id$
*/
-
-#ifndef _BELOOPANA_H_
-#define _BELOOPANA_H_
+#ifndef FIRM_BE_BELOOPANA_H
+#define FIRM_BE_BELOOPANA_H
#include "irloop.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "beirg.h"
typedef struct _be_loopana_t be_loopana_t;
*/
void be_free_loop_pressure(be_loopana_t *loop_ana);
-#endif /* _BELOOPANA_H_ */
+#endif /* FIRM_BE_BELOOPANA_H */
/**
* @file
- * @brief Performs lowering of perm nodes and spill/reload optimization.
+ * @brief Performs lowering of perm nodes. Inserts copies to assure register constraints.
* @author Christian Wuerdig
* @date 14.12.2005
* @version $Id$
*/
/**
- * Chordal register allocation.
- * @author Christian Wuerdig
- * @date 2005/12/14
- * @cvsid $Id$
+ * @file
+ * @brief Performs lowering of perm nodes. Inserts copies to assure register constraints.
+ * @author Christian Wuerdig
+ * @date 14.12.2005
+ * @version $Id$
*/
-#ifndef _BELOWER_H_
-#define _BELOWER_H_
+#ifndef FIRM_BE_BELOWER_H
+#define FIRM_BE_BELOWER_H
#include "beirg.h"
void assure_constraints(be_irg_t *birg);
void lower_nodes_after_ra(be_irg_t *birg, int do_copy);
-#endif /* _BELOWER_H_ */
+#endif /* FIRM_BE_BELOWER_H */
*/
/**
- * Abstract machine interface.
- * @author Christian Wuerdig
- * @date 01.12.2006
- * @cvs-id $Id$
+ * @file
+ * @brief Abstract machine interface.
+ * @author Christian Wuerdig
+ * @date 01.12.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
* PURPOSE.
*/
-#ifndef _BE_MACHINE_H_
-#define _BE_MACHINE_H_
-
/**
- * Abstract machine interface.
- * @author Christian Wuerdig
- * @date 23.10.2006
- * @cvs-id $Id$
+ * @file
+ * @brief Abstract machine interface.
+ * @author Christian Wuerdig
+ * @date 23.10.2006
+ * @version $Id$
*/
+#ifndef FIRM_BE_BEMACHINE_H
+#define FIRM_BE_BEMACHINE_H
typedef struct _be_execution_unit_type_t be_execution_unit_type_t;
typedef struct _be_execution_unit_t be_execution_unit_t;
*/
#define be_machine_get_execunit_type(unit) ((unit)->tp)
-#endif /* _BE_MACHINE_H_ */
+#endif /* FIRM_BE_BEMACHINE_H */
* PURPOSE.
*/
+/**
+ * @file
+ * @brief Support for machine nodes with machine operands.
+ * @author Michael Beck
+ * @version $Id$
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
*/
/**
- * Support for machine nodes with machine operands.
- *
- * @author Michael Beck
+ * @file
+ * @brief Support for machine nodes with machine operands.
+ * @author Michael Beck
+ * @version $Id$
*/
-#ifndef _BEMACHNODES_H
-#define _BEMACHNODES_H
+#ifndef FIRM_BE_BEMACHNODES_H
+#define FIRM_BE_BEMACHNODES_H
-#include "firm_types.h"
+#include "irnode.h"
/*
* Machine nodes can have machine operands as inputs.
/* Convenience: Returns the arity of a machine node. */
int _get_mirn_arity(ir_node *n);
-#endif /* _BEMACHNODES_H */
+#endif /* FIRM_BE_BEMACHNODES_H */
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 29.09.2005
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
- * CVS-Id: $Id$
+/**
+ * @file
+ * @brief Backend module interface.
+ * @author Matthias Braun
+ * @date 29.09.2005
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 11.12.2006
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Backend module interface.
+ * @author Matthias Braun
+ * @date 11.12.2006
+ * @version $Id$
*/
-#ifndef BEMODULE_H_
-#define BEMODULE_H_
+#ifndef FIRM_BE_BEMODULE_H
+#define FIRM_BE_BEMODULE_H
/**
* Mark a function as module constructor.
be_module_list_entry_t * const * first,
void **var);
-#endif
+#endif /* FIRM_BE_BEMODULE_H */
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 11.12.2006
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Backend module interface.
+ * @author Matthias Braun
+ * @date 11.12.2006
+ * @version $Id$
*/
-#ifndef BEMODULE_T_H_
-#define BEMODULE_T_H_
+#ifndef FIRM_BE_BEMODULE_T_H
+#define FIRM_BE_BEMODULE_T_H
#include "bemodule.h"
struct be_module_list_entry_t *next;
};
-#endif
+#endif /* FIRM_BE_BEMODULE_T_H */
* PURPOSE.
*/
-/*
- * Project: libFIRM
- * File name: ir/be/benode.c
- * Purpose: Backend node support for generic backend nodes.
- * Author: Sebastian Hack
- * Modified by: Michael Beck, Matthias Braun
- * Created: 17.05.2005
- * CVS-ID: $Id$
- * Copyright: (c) 1998-2007 Universität Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
- */
-
/**
- * @file benode.c
- * @date 17.05.2005
- * @author Sebastian Hack
+ * @file
+ * @brief Backend node support for generic backend nodes.
+ * @author Sebastian Hack
+ * @date 17.05.2005
+ * @version $Id$
*
* Backend node support for generic backend nodes.
* This file provides Perm, Copy, Spill and Reload nodes.
*/
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
*/
/**
- * @file benode_t.h
- * @date 17.05.2005
- * @author Sebastian Hack
+ * @file
+ * @brief Backend node support for generic backend nodes.
+ * @author Sebastian Hack
+ * @date 17.05.2005
+ * @version $Id$
*
- * Backend node support.
- *
- * Copyright (C) 2005 Universitaet Karlsruhe
- * Released under the GPL
+ * Backend node support for generic backend nodes.
+ * This file provides Perm, Copy, Spill and Reload nodes.
*/
-
-#ifndef _BENODE_T_H
-#define _BENODE_T_H
-
-#include "firm_config.h"
+#ifndef FIRM_BE_BENODE_T_H
+#define FIRM_BE_BENODE_T_H
#include <limits.h>
#include "irmode.h"
#include "irnode.h"
-#include "entity_t.h"
+#include "irgraph.h"
+#include "entity.h"
-#include "be_t.h"
-#include "bearch_t.h"
+#include "bearch.h"
#define BE_OUT_POS(p) (-((p) + 1))
*/
extern const arch_irn_handler_t be_node_irn_handler;
-#endif /* _BENODE_T_H */
+#endif /* FIRM_BE_BENODE_T_H */
* PURPOSE.
*/
+/**
+ * @file
+ * @brief A lightweight wrapper around pset to store IR nodes.
+ * @author Michael Beck
+ * @version $Id$
+ *
+ * In some algorithms we want a more deterministic behavior
+ * which the pset_ptr did not guarantee due to it's hash function
+ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
*/
/**
- * A lightweight wrapper around pset to store IR nodes.
+ * @file
+ * @brief A lightweight wrapper around pset to store IR nodes.
+ * @author Michael Beck
+ * @version $Id$
+ *
* In some algorithms we want a more deterministic behavior
* which the pset_ptr did not guarantee due to it's hash function
*/
-#ifndef _BENODESETS_H
-#define _BENODESETS_H
+#ifndef FIRM_BE_BENODESETS_H
+#define FIRM_BE_BENODESETS_H
-#include "firm_types.h"
+#include "irnode.h"
#include "pset.h"
typedef struct pset nodeset;
*/
#define foreach_nodeset(nset, irn) for (irn = nodeset_first(nset); irn; irn = nodeset_next(nset))
-#endif /* _BENODESETS_H */
+#endif /* FIRM_BE_BENODESETS_H */
* PURPOSE.
*/
-#ifndef PRESSURE_STAT_H_
-#define PRESSURE_STAT_H_
+/**
+ * @file
+ * @brief Register Pressure Statistics.
+ * @author Adam M. Szalkowski
+ * @date 06.04.2006
+ * @version $Id$
+ */
+#ifndef FIRM_BE_BEPRESSURE_STAT_H
+#define FIRM_BE_BEPRESSURE_STAT_H
+
+#include "beirg.h"
+#include "bearch.h"
-void be_analyze_regpressure(be_irg_t *birg, const arch_register_class_t *cls,
- const char * suffix);
+void be_analyze_regpressure(be_irg_t *birg, const arch_register_class_t *cls, const char *suffix);
-#endif
+#endif /* FIRM_BE_BEPRESSURE_STAT_H */
* PURPOSE.
*/
-/** vim: set sw=4 ts=4:
- * @file beprofile.c
- * @date 2006-04-06
- * @author Adam M. Szalkowski
- * @cvs-id $Id$
- *
- * Code instrumentation and execution count profiling
- *
- * Copyright (C) 2006 Universitaet Karlsruhe
- * Released under the GPL
+/**
+ * @file
+ * @brief Code instrumentation and execution count profiling.
+ * @author Adam M. Szalkowski
+ * @date 06.04.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
* PURPOSE.
*/
-/** vim: set sw=4 ts=4:
- * @file beprofile.h
- * @date 2006-04-06
- * @author Adam M. Szalkowski
- * @cvs-id $Id$
- *
- * Code instrumentation and execution count profiling
- *
- * Copyright (C) 2006 Universitaet Karlsruhe
- * Released under the GPL
+/**
+ * @file
+ * @brief Code instrumentation and execution count profiling.
+ * @author Adam M. Szalkowski
+ * @date 06.04.2006
+ * @version $Id$
*/
+#ifndef FIRM_BE_BEPROFILE_H
+#define FIRM_BE_BEPROFILE_H
-#ifndef _BEPROFILE_H_
-#define _BEPROFILE_H_
+#include "irgraph.h"
+#include "irnode.h"
/** Additional flags for profiling */
enum profile_flags {
*/
int be_profile_has_data(void);
-#endif /* _BEPROFILE_H_ */
+#endif /* FIRM_BE_BEPROFILE_H */
*/
/**
- * Base routines for register allocation.
- * @author Sebastian Hack
- * @date 22.11.2004
+ * @file
+ * @brief Base routines for register allocation.
+ * @author Sebastian Hack
+ * @date 22.11.2004
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "irnode.h"
#include "irmode.h"
#include "irdom.h"
+#include "iredges.h"
#include "bera.h"
#include "beutil.h"
*/
/**
- * Register allocation functions.
- * @author Sebastian Hack
- * @date 13.1.2005
+ * @file
+ * @brief Base routines for register allocation.
+ * @author Sebastian Hack
+ * @date 13.01.2005
+ * @version $Id$
*/
-#ifndef _BERA_H
-#define _BERA_H
-
-#include "firm_config.h"
+#ifndef FIRM_BE_BERA_H
+#define FIRM_BE_BERA_H
#include <libcore/lc_timing.h>
-#include "firm_types.h"
+#include "irnode.h"
-#include "be.h"
#include "belive.h"
#include "beirg.h"
-#include "bemodule.h"
typedef struct {
lc_timer_t *t_prolog; /**< timer for prolog */
*/
int value_dominates_intrablock(const ir_node *a, const ir_node *b);
-#endif /* _BERA_H */
+#endif /* FIRM_BE_BERA_H */
*/
/**
- * Author: Daniel Grund
- * Date: 17.01.2006
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
- *
- * Implementation of the RA-Interface for an external, (non-SSA) register allocator.
+ * @file
+ * @brief Implementation of the RA-Interface for an external, (non-SSA) register allocator.
+ * @author Daniel Grund
+ * @date 17.01.2006
+ * @version $Id$
*
* The external register allocator is a program:
* PROG -i INPUTFILE -o OUTPUTFILE
alloc ::= node-nr reg-nr .
-
-******** End of file format docu ********/
+*/
#ifdef NOT_PORTED
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
- * Author: Daniel Grund
- * Date: 17.01.2006
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ * @file
+ * @brief Implementation of the RA-Interface for an external, (non-SSA) register allocator.
+ * @author Daniel Grund
+ * @date 17.01.2006
+ * @version $Id$
*
- * Implementation of the RA-Interface for an external, non-SSA register allocator
- */
-#ifndef _BERAEXTERN_H
-#define _BERAEXTERN_H
+ * The external register allocator is a program:
+ * PROG -i INPUTFILE -o OUTPUTFILE
+ *
+ * 1) Input file defines the interference graph
+ * 2) Output file contains the instructions to perform
+ *
+
+
+The input file format
+----------------------
+
+inputfile ::= regs nodes interf affinities .
+
+regs ::= 'regs' regcount . // Anzahl der register (0..regcount-1), die zur Verfuegung stehen
+
+nodes ::= 'nodes' '{' node* '}' . // All nodes in the graph
+
+node ::= node-info
+ | node-info '<' reg-nr '>' . // Reg-nr is present in case of constraints
+
+node-info ::= node-nr spill-costs .
+
+interf ::= 'interferences' '{' i-edge* '}' . // Interference edges of the graph
+
+i-edge ::= '(' node-nr ',' node-nr ')' .
+
+affinities ::= 'affinities' '{' a-edge* '}' . // Affinity edges of the graph
+
+a-edge ::= '(' node-nr ',' node-nr ',' weight ')' .
+
+
+weight, regcount, node-nr ::= int32 .
+spill-costs ::= int32 . // negative spill costs indicate unspillable
+
+The output file format
+-----------------------
+
+outputfile ::= spills | allocs .
+
+spills ::= 'spills' node-nr+ .
+
+allocs ::= 'allocs' alloc* .
+
+alloc ::= node-nr reg-nr .
+
+*/
+
+#ifndef FIRM_BE_BERAEXTERN_H
+#define FIRM_BE_BERAEXTERN_H
#include "bera.h"
-#endif
+#endif /* FIRM_BE_BERAEXTERN_H */
* PURPOSE.
*/
-/* $Id$ */
-
+/**
+ * @file
+ * @brief Scheduling utilities for nodes in Blocks and Blocks.
+ * @author Sebastian Hack
+ * @version $Id$
+ */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
* PURPOSE.
*/
-/*
- * Scheduling utilities for nodes in Blocks and Blocks.
- *
- * $Id$
+/**
+ * @file
+ * @brief Scheduling utilities for nodes in Blocks and Blocks.
+ * @author Sebastian Hack
+ * @version $Id$
*/
-#ifndef _BESCHED_H
-#define _BESCHED_H
+#ifndef FIRM_BE_BESCHED_H
+#define FIRM_BE_BESCHED_H
#include <stdio.h>
-#include "firm_types.h"
+#include "irgraph.h"
+#include "irnode.h"
void be_sched_dump(FILE *f, ir_graph *irg);
*/
void be_remove_dead_nodes_from_schedule(ir_graph *irg);
-#endif /* _BESCHED_H */
+#endif /* FIRM_BE_BESCHED_H */
* PURPOSE.
*/
-/* $Id$ */
-
-#ifndef _BESCHED_T_H
-#define _BESCHED_T_H
+/**
+ * @file
+ * @brief Scheduling utilities for nodes in Blocks and Blocks.
+ * @author Sebastian Hack
+ * @version $Id$
+ */
+#ifndef FIRM_BE_BESCHED_T_H
+#define FIRM_BE_BESCHED_T_H
#define SCHED_INITIAL_GRANULARITY (1 << 14)
#define sched_comes_after(n1, n2) _sched_comes_after(n1, n2)
#define sched_cmp(a, b) _sched_cmp(a, b)
-#endif
+#endif /* FIRM_BE_BESCHED_T_H */
*/
/**
+ * @file
+ * @brief Implements a list scheduler for the MRIS algorithm.
+ * @author Sebastian Hack
+ * @date 04.04.2006
+ * @version $Id$
+ *
* Implements a list scheduler for the MRIS algorithm in:
* Govindarajan, Yang, Amaral, Zhang, Gao
* Minimum Register Instruction Sequencing to Reduce Register Spills
* in out-of-order issue superscalar architectures
- * @author Sebastian Hack
- * @date 04.04.2006
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "irgwalk.h"
#include "irtools.h"
#include "irbitset.h"
-
#include "height.h"
#include "benode_t.h"
#include "beirg.h"
struct _mris_env_t {
- ir_phase ph;
+ ir_phase ph;
heights_t *heights;
const arch_env_t *aenv;
ir_graph *irg;
*/
/**
- * Implements a list schedule selector for the MRIS algorithm in:
+ * @file
+ * @brief Implements a list scheduler for the MRIS algorithm.
+ * @author Sebastian Hack
+ * @date 04.04.2006
+ * @version $Id$
+ *
+ * Implements a list scheduler for the MRIS algorithm in:
* Govindarajan, Yang, Amaral, Zhang, Gao
* Minimum Register Instruction Sequencing to Reduce Register Spills
* in out-of-order issue superscalar architectures
*/
+#ifndef FIRM_BE_BESCHEDMRIS_H
+#define FIRM_BE_BESCHEDMRIS_H
-#ifndef _BESCHEDMRIS_H
-#define _BESCHEDMRIS_H
-
-#include "be.h"
-#include "belistsched.h"
+#include "beirg.h"
typedef struct _mris_env_t mris_env_t;
*/
void dump_ir_block_graph_mris(mris_env_t *env, const char *suffix);
-#endif /* _BESCHEDMRIS_H */
+#endif /* FIRM_BE_BESCHEDMRIS_H */
*/
/**
- * Trivial node selector.
- * @author Matthias Braun
- * @date 29.08.2006
- * @cvs-id $Id$
+ * @file
+ * @brief Random node selector.
+ * @author Matthias Braun
+ * @date 29.08.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
}
}
- if(only_branches_left) {
+ if (only_branches_left) {
/* at last: schedule branches */
ir_nodeset_iterator_init(&iter, ready_set);
irn = ir_nodeset_iterator_next(&iter);
} else {
do {
- // take 1 random node
+ /* take 1 random node */
int n = rand() % ir_nodeset_size(ready_set);
int i = 0;
ir_nodeset_iterator_init(&iter, ready_set);
- while( (irn = ir_nodeset_iterator_next(&iter)) != NULL) {
+ while ((irn = ir_nodeset_iterator_next(&iter)) != NULL) {
if(i == n) {
break;
}
*/
/**
- * Regpressure node selector.
- * Originally implemented by Sebastian Hack.
- * @author Christian Wuerdig
- * @date 29.08.2006
- * @cvs-id $Id$
+ * @file
+ * @brief Regpressure node selector.
+ * @author Sebastian Hack
+ * @date 29.08.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
+ * @file
+ * @brief Implementation of a register saturating list scheduler.
+ * @author Christian Wuerdig
+ * @date 29.08.2006
+ * @version $Id$
+ *
* Implementation of a register saturating list scheduler
* as described in: Sid-Ahmed-Ali Touati
* Register Saturation in Superscalar and VLIW Codes
- *
- * @license This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
- * @author Christian Wuerdig
- * @date 29.08.2006
- * @cvs-id $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
- * Interface for register saturating list scheduler
+ * @file
+ * @brief Implementation of a register saturating list scheduler.
+ * @author Christian Wuerdig
+ * @date 06.09.2006
+ * @version $Id$
+ *
+ * Implementation of a register saturating list scheduler
* as described in: Sid-Ahmed-Ali Touati
* Register Saturation in Superscalar and VLIW Codes
- * @author Christian Wuerdig
- * @date 06.09.2006
- * @cvs-id $Id$
*/
-#ifndef _BESCHEDRSS_H_
-#define _BESCHEDRSS_H_
+#ifndef FIRM_BE_BESCHEDRSS_H
+#define FIRM_BE_BESCHEDRSS_H
-#include "firm_config.h"
+#include "beirg.h"
/**
* Perform RSS schedule preprocessing for the given irg.
*/
void rss_schedule_preparation(const be_irg_t *birg);
-#endif /* _BESCHEDRSS_H_ */
+#endif /* FIRM_BE_BESCHEDRSS_H */
*/
/**
- * Implements a trace scheduler as presented in Muchnik[TM].
- * Originally implemented by Michael Beck.
- * @author Christian Wuerdig
- * @date 28.08.2006
- * @cvs-id $Id$
+ * @file
+ * @brief Implements a trace scheduler as presented in Muchnik[TM].
+ * @author Michael Beck
+ * @date 28.08.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
- * Trivial node selector.
- * @author Christian Wuerdig
- * @date 29.08.2006
- * @cvs-id $Id$
+ * @file
+ * @brief Trivial node selector.
+ * @author Sebastian Hack
+ * @date 29.08.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include <stdlib.h>
-#include "besched_t.h"
+#include "irgraph.h"
+#include "irnode.h"
+#include "irnodeset.h"
+
+#include "bearch.h"
#include "belistsched.h"
/**
* PURPOSE.
*/
-/*
- * Author: Daniel Grund, Sebastian Hack, Matthias Braun
- * Date: 29.09.2005
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Main spill driver.
+ * @author Daniel Grund, Sebastian Hack, Matthias Braun
+ * @date 29.09.2005
+ * @version $Id$
*/
-#ifndef BESPILL_H_
-#define BESPILL_H_
+#ifndef FIRM_BE_BESPILL_H
+#define FIRM_BE_BESPILL_H
-#include "firm_types.h"
-#include "set.h"
-#include "pset.h"
+#include "irnode.h"
#include "debug.h"
-#include "be_t.h"
-
-#include "bearch_t.h"
+#include "bearch.h"
+#include "beirg.h"
typedef struct _spill_env_t spill_env_t;
*/
int be_get_reload_costs_on_edge(spill_env_t *env, ir_node *to_spill, ir_node *block, int pos);
-#endif
+#endif /* FIRM_BE_BESPILL_H */
#include "beutil.h"
#include "bearch_t.h"
#include "bespillbelady.h"
-#include "beuses_t.h"
+#include "beuses.h"
#include "besched_t.h"
#include "beirgmod.h"
#include "belive_t.h"
*/
/**
- * Author: Daniel Grund, Matthias Braun
- * Date: 20.09.2005
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ * @file
+ * @brief Beladys spillalgorithm.
+ * @author Daniel Grund, Matthias Braun
+ * @date 20.09.2005
+ * @version $Id$
*/
-
-#ifndef BESPILLBELADY_H_
-#define BESPILLBELADY_H_
+#ifndef FIRM_BE_BESPILLBELADY_H
+#define FIRM_BE_BESPILLBELADY_H
#include "beirg.h"
#include "bearch.h"
void be_spill_belady_spill_env(be_irg_t *birg, const arch_register_class_t *cls,
spill_env_t *spill_env);
-#endif /*BESPILLBELADY_H_*/
+#endif /* FIRM_BE_BESPILLBELADY_H */
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 05.05.2006
- * Copyright: (c) Universitaet Karlsruhe
- * License: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Morgans spill algorithm.
+ * @author Matthias Braun
+ * @date 05.05.2006
+ * @version $Id$
*/
-#ifndef BESPILLMORGAN_H_
-#define BESPILLMORGAN_H_
+#ifndef FIRM_BE_BESPILLMORGAN_H
+#define FIRM_BE_BESPILLMORGAN_H
#include "beirg.h"
#include "bearch.h"
void be_spill_morgan(be_irg_t *birg, const arch_register_class_t *cls);
-#endif
+#endif /* FIRM_BE_BESPILLMORGAN_H */
* PURPOSE.
*/
-/*
- * Author: Daniel Grund, Sebastian Hack, Matthias Braun
- * Date: 29.09.2005
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Option handling for spiller.
+ * @author Daniel Grund, Sebastian Hack, Matthias Braun
+ * @date 29.09.2005
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 12.10.2006
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Option handling for spiller.
+ * @author Matthias Braun
+ * @date 12.10.2006
+ * @version $Id$
*/
-#ifndef BESPILL_OPTIONS_H_
-#define BESPILL_OPTIONS_H_
+#ifndef FIRM_BE_BESPILL_OPTIONS_H
+#define FIRM_BE_BESPILL_OPTIONS_H
#include "bearch.h"
#include "beirg.h"
extern int be_do_remats;
typedef struct be_spiller_t {
- void (*spill) (be_irg_t *birg, const arch_register_class_t* cls);
+ void (*spill) (be_irg_t *birg, const arch_register_class_t *cls);
} be_spiller_t;
void be_register_spiller(const char *name, be_spiller_t *spiller);
-void be_do_spill(be_irg_t *birg, const arch_register_class_t* cls);
+void be_do_spill(be_irg_t *birg, const arch_register_class_t *cls);
-#endif
+#endif /* FIRM_BE_BESPILL_OPTIONS_H */
* PURPOSE.
*/
-/** vim: set sw=4 ts=4:
- * @file bespillremat.c
- * @date 2006-04-06
- * @author Adam M. Szalkowski & Sebastian Hack
- *
- * ILP based spilling & rematerialization
- *
- * Copyright (C) 2006 Universitaet Karlsruhe
- * Released under the GPL
+/**
+ * @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"
*/
/**
- * @file bespillremat.h
- * @date 2006-04-06
- * @author Adam M. Szalkowski
- *
- * Copyright (C) 2006 Universitaet Karlsruhe
- * Released under the GPL
+ * @file
+ * @brief ILP based spilling & rematerialization
+ * @author Adam M. Szalkowski
+ * @date 06.04.2006
+ * @version $Id$
*/
+#ifndef FIRM_BE_BESPILLREMAT_H
+#define FIRM_BE_BESPILLREMAT_H
-#ifndef BESPILLREMAT_H_
-#define BESPILLREMAT_H_
+#include "bearch.h"
+#include "beirg.h"
void be_spill_remat(be_irg_t *birg, const arch_register_class_t *cls);
-#endif /*BESPILLREMAT_H_*/
+#endif /* FIRM_BE_BESPILLREMAT_H */
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 26.7.06
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Spillslot coalescer.
+ * @author Matthias Braun
+ * @date 26.07.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include <stdlib.h>
#include "set.h"
-
+#include "array.h"
#include "irgwalk.h"
#include "ircons.h"
#include "irprintf.h"
#include "bemodule.h"
#include "bera.h"
#include "beirg_t.h"
+#include "bearch_t.h"
#define DBG_COALESCING 1
#define DBG_INTERFERENCES 2
if (!arch_irn_class_is(arch_env, node, reload))
return;
- mode = get_irn_mode(node);
- cls = arch_get_irn_reg_class(arch_env, node, -1);
+ mode = get_irn_mode(node);
+ cls = arch_get_irn_reg_class(arch_env, node, -1);
align = arch_isa_get_reg_class_alignment(arch_env_get_isa(arch_env), cls);
be_node_needs_frame_entity(env, node, mode, align);
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 27.7.2006
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+/**
+ * @file
+ * @brief Spillslot coalescer.
+ * @author Matthias Braun
+ * @date 27.07.2006
+ * @version $Id$
*/
-#ifndef BESPILLSLOTS_H_
-#define BESPILLSLOTS_H_
+#ifndef FIRM_BE_BESPILLSLOTS_H
+#define FIRM_BE_BESPILLSLOTS_H
#include "beirg.h"
*/
void be_coalesce_spillslots(be_irg_t *birg);
-#endif /* BESPILLSLOTS_H_ */
+#endif /* FIRM_BE_BESPILLSLOTS_H */
/**
* @file
- * @brief SSA construction for a set of nodes
+ * @brief SSA construction for a set of nodes
* @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
* @date 04.05.2005
* @version $Id$
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*
* The problem: Given a value and a set of "copies" that are known to
* represent the same abstract value, rewire all usages of the original value
* found, then we search one in the immediate dominator. If we are in a block
* of the dominance frontier, create a phi and search do the same search for
* the phi arguments.
+ *
+ * A copy in this context means, that you want to introduce several new
+ * abstract values (in Firm: nodes) for which you know, that they
+ * represent the same concrete value. This is the case if you
+ * - copy
+ * - spill and reload
+ * - re-materialize
+ * a value.
+ *
+ * This function reroutes all uses of the original value to the copies in the
+ * corresponding dominance subtrees and creates Phi functions where necessary.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
/**
* @file
- * @brief Introduce several copies for one node.
- * @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
- * @date 30.03.2007
- * @version $Id$
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
-
+ * @brief SSA construction for a set of nodes
+ * @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
+ * @date 30.03.2007
+ * @version $Id$
+ *
+ * The problem: Given a value and a set of "copies" that are known to
+ * represent the same abstract value, rewire all usages of the original value
+ * to their closest copy while introducing phis as necessary.
+ *
+ * Algorithm: Mark all blocks in the iterated dominance frontiers of the value
+ * and it's copies. Link the copies ordered by dominance to the blocks. The
+ * we search for each use all all definitions in the current block, if none is
+ * found, then we search one in the immediate dominator. If we are in a block
+ * of the dominance frontier, create a phi and search do the same search for
+ * the phi arguments.
+ *
* A copy in this context means, that you want to introduce several new
* abstract values (in Firm: nodes) for which you know, that they
* represent the same concrete value. This is the case if you
* This function reroutes all uses of the original value to the copies in the
* corresponding dominance subtrees and creates Phi functions where necessary.
*/
-#ifndef FIRM_BE_SSACONSTR_H
-#define FIRM_BE_SSACONSTR_H
+#ifndef FIRM_BE_BESSACONSTR_H
+#define FIRM_BE_BESSACONSTR_H
#include <stdlib.h>
#include "bedomfront.h"
#include "pdeq.h"
typedef struct be_ssa_construction_env_t {
- ir_graph *irg;
- const be_dom_front_info_t *domfronts;
- ir_mode *mode;
- waitq *worklist;
- const ir_nodeset_t *ignore_uses;
+ ir_graph *irg;
+ const be_dom_front_info_t *domfronts;
+ ir_mode *mode;
+ waitq *worklist;
+ const ir_nodeset_t *ignore_uses;
ir_node **new_phis;
- int iterated_domfront_calculated;
+ int iterated_domfront_calculated;
} be_ssa_construction_env_t;
/**
*/
void be_ssa_construction_destroy(be_ssa_construction_env_t *env);
-#endif
+#endif /* FIRM_BE_BESSACONSTR_H */
*/
/**
- * Author: Daniel Grund
- * Date: 25.05.2005
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
- *
- * Performs SSA-Destruction.
+ * @file
+ * @brief Performs SSA-Destruction.
+ * @author Daniel Grund
+ * @date 25.05.2005
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
- * Author: Daniel Grund
- * Date: 25.05.2005
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
- *
- * Performs SSA-Destruction.
+ * @file
+ * @brief Performs SSA-Destruction.
+ * @author Daniel Grund
+ * @date 25.05.2005
+ * @version $Id$
*/
+#ifndef FIRM_BE_BESSADESTR_H
+#define FIRM_BE_BESSADESTR_H
-#include "bechordal_t.h"
+#include "bechordal.h"
/**
* Performs SSA-Destruction. Arguments get adjusted, phi nodes just stay.
*/
void be_ssa_destruction(be_chordal_env_t *chordal_env);
void be_ssa_destruction_check(be_chordal_env_t *chordal_env);
+
+#endif /* FIRM_BE_BESSADESTR_H */
*/
/**
- * Author: Daniel Grund
- * Date: 17.01.2006
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
- *
+ * @file
+ * @brief Simple SSA destruction.
+ * @author Daniel Grund
+ * @date 17.01.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
* PURPOSE.
*/
+/**
+ * @file
+ * @brief Simple SSA destruction.
+ * @author Daniel Grund
+ * @date 17.01.2006
+ * @version $Id$
+ */
+#ifndef FIRM_BE_BESSADESTRSIMPLE_H
+#define FIRM_BE_BESSADESTRSIMPLE_H
+
+#include "set.h"
#include "pset.h"
+#include "irgraph.h"
+#include "irnode.h"
+
+#include "bearch.h"
/**
* Insert copys to destruct SSA form and
* The link field of an irn points to the var_info struct
* representing the corresponding variable.
*/
-#define be_get_var_info(irn) ((be_var_info_t *)get_irn_link(irn))
+#define be_get_var_info(irn) ((be_var_info_t *)get_irn_link(irn))
#define SET_REMOVED -1
be_var_info_t *be_var_add_value(set *vars, int var_nr, ir_node *irn);
be_var_info_t *be_var_find_or_insert(set *vars, int var_nr);
be_var_info_t *be_var_find(set *vars, int var_nr);
+
+#endif /* FIRM_BE_BESSADESTRSIMPLE_H */
*/
/**
- * This file calls the corresponding statistic functions for
- * some backend statistics.
- * @author Christian Wuerdig
- * $Id$
+ * @file
+ * @brief Provides several statistic functions for the backend.
+ * @author Christian Wuerdig
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "irtools.h"
#include "pset.h"
+#include "bearch_t.h"
#include "bestat.h"
#include "belive_t.h"
#include "besched.h"
* @author Christian Wuerdig
* @version $Id$
*/
-#ifndef FIRM_BE_BESTAT_H_
-#define FIRM_BE_BESTAT_H_
+#ifndef FIRM_BE_BESTAT_H
+#define FIRM_BE_BESTAT_H
#include "firm_config.h"
#include "irnode.h"
#include "irgraph.h"
#include "irnodeset.h"
+#include "execfreq.h"
#include "beirg.h"
#include "bestatevent.h"
void be_init_stat_file(const char *filename, const char *sourcefilename);
void be_close_stat_file(void);
-#else
+#else /* ! FIRM_STATISTICS */
#define be_stat_init_irg(arch_env, irg)
#define be_do_stat_nodes(irg, phase)
*/
double be_estimate_irg_costs(ir_graph *irg, const arch_env_t *arch_env, ir_exec_freq *execfreqs);
-#endif /* FIRM_BE_BESTAT_H_ */
+#endif /* FIRM_BE_BESTAT_H */
* @author Matthias Braun
* @date 26.03.2007
* @version $Id$
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "irgmod.h"
#include "bearch_t.h"
-#include "beuses_t.h"
+#include "beuses.h"
#include "besched_t.h"
#include "belive_t.h"
#include "bemodule.h"
* @author Matthias Braun
* @date 26.03.2007
* @version $Id$
- * Copyright: (c) Universitaet Karlsruhe
- * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
#ifndef FIRM_BE_BESTATE_H
#define FIRM_BE_BESTATE_H
* Callback that should create a spill for a certain value. Can return NULL
* if @p force == 0 and the value can be easily rematerialized
*/
-typedef ir_node* (*create_spill_func) (void *env, ir_node *value, int force,
- ir_node *after);
+typedef ir_node *(*create_spill_func) (void *env, ir_node *value, int force, ir_node *after);
/**
* Callback that should create a reload for a certain value
*/
-typedef ir_node* (*create_reload_func) (void *env, ir_node *value,
+typedef ir_node *(*create_reload_func) (void *env, ir_node *value,
ir_node *spill, ir_node *before,
ir_node *last_value);
create_spill_func spill_func,
create_reload_func reload_func);
-#endif
+#endif /* FIRM_BE_BESTATE_H */
*/
/**
- * Statistic events
- * @date 3.9.2006
- * @author Sebastian Hack
- * @version $Id$
+ * @file
+ * @brief Statistic events.
+ * @author Sebastian Hack
+ * @date 03.09.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include <assert.h>
#include <string.h>
+#include <stdio.h>
#include "bestatevent.h"
*/
/**
- * Statistic events
- * @date 3.9.2006
- * @author Sebastian Hack
+ * @file
+ * @brief Statistic events.
+ * @author Sebastian Hack
+ * @date 03.09.2006
+ * @version $Id$
*/
-
-#ifndef _BESTATEVENT_H
-#define _BESTATEVENT_H
+#ifndef FIRM_BE_BESTATEVENT_H
+#define FIRM_BE_BESTATEVENT_H
#include <stdio.h>
int be_stat_ev_is_active(void);
-#endif /* _BESTATEVENT_H */
+#endif /* FIRM_BE_BESTATEVENT_H */
*/
/**
- * @file beuse.c
- * @date 27.06.2005
- * @author Sebastian Hack, Matthias Braun
- *
- * Methods to compute when a value will be used again.
- *
- * Copyright (C) 2005 Universitaet Karlsruhe
- * Released under the GPL
+ * @file
+ * @brief Methods to compute when a value will be used again.
+ * @author Sebastian Hack, Matthias Braun
+ * @date 27.06.2005
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "besched_t.h"
#include "beirgmod.h"
#include "bearch_t.h"
-#include "beuses_t.h"
+#include "beuses.h"
#include "benodesets.h"
#define SCAN_INTERBLOCK_USES
*/
/**
- * @file beuse.h
- * @date 27.06.2005
- * @author Sebastian Hack, Matthias Braun
- *
- * Determine future usages of values.
- *
- * Copyright (C) 2005 Universitaet Karlsruhe
- * Released under the GPL
+ * @file
+ * @brief Methods to compute when a value will be used again.
+ * @author Sebastian Hack, Matthias Braun
+ * @date 27.06.2005
+ * @version $Id$
*/
-#ifndef _BEUSES_H
-#define _BEUSES_H
+#ifndef FIRM_BE_BEUSES_H
+#define FIRM_BE_BEUSES_H
+
+#include "irgraph.h"
+#include "irnode.h"
-#include "bearch_t.h"
#include "belive.h"
typedef struct _be_next_use_t {
unsigned time;
- int outermost_loop;
+ int outermost_loop;
} be_next_use_t;
-#define USES_INFINITY 10000000
-#define USES_PENDING 9999999
+#define USES_INFINITY 10000000
+#define USES_PENDING 9999999
static INLINE int USES_IS_INFINITE(unsigned time)
{
void be_end_uses(be_uses_t *uses);
-#endif /* _BEUSES_H */
+#endif /* FIRM_BE_BEUSES_H */
*/
/**
- * Contains some useful function for the backend.
- * @author Sebastian Hack
- * @version $Id$
+ * @file
+ * @brief Contains some useful function for the backend.
+ * @author Sebastian Hack
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
* PURPOSE.
*/
-
-#ifndef _BEUTIL_H
-#define _BEUTIL_H
+/**
+ * @file
+ * @brief Contains some useful function for the backend.
+ * @author Sebastian Hack
+ * @version $Id$
+ */
+#ifndef FIRM_BE_BEUTIL_H
+#define FIRM_BE_BEUTIL_H
#include "firm_config.h"
#include <stdio.h>
#include "pset.h"
+#include "irgraph.h"
#include "irnode.h"
+#include "irmode.h"
+
#include "bearch_t.h"
/* iterate over a list of ir_nodes linked by link field */
int i, n;
/* If the node produces a data value, return immediately. */
- if(is_firm_be_mode(get_irn_mode(irn)))
+ if (is_firm_be_mode(get_irn_mode(irn)))
return 1;
/* else check, if it takes a data value, if that is so, return */
for(i = 0, n = get_irn_arity(irn); i < n; ++i) {
ir_node *op = get_irn_n(irn, i);
- if(is_firm_be_mode(get_irn_mode(op)))
+ if (is_firm_be_mode(get_irn_mode(op)))
return 1;
}
*/
ir_node *be_get_Proj_for_pn(const ir_node *irn, long pn);
-#endif /* _BEUTIL_H */
+#endif /* FIRM_BE_BEUTIL_H */
* PURPOSE.
*/
-/*
- * Author: Matthias Braun
- * Date: 05.05.2006
- * Copyright: (c) Universitaet Karlsruhe
- * License: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
- * CVS-Id: $Id$
+/**
+ * @file
+ * @brief Various verify routines that check a scheduled graph for correctness.
+ * @author Matthias Braun
+ * @date 05.05.2006
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
*/
/**
- * Author: Matthias Braun
- * Date: 05.05.2006
- * Copyright: (c) Universitaet Karlsruhe
- * License: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
- * CVS-Id: $Id$
+ * @file
+ * @brief Various verify routines that check a scheduled graph for correctness.
+ * @author Matthias Braun
+ * @date 05.05.2006
+ * @version $Id$
*/
-
-/**
- * @file beverify.h
- *
- * Various verify routines that check a scheduled graph for correctness
- *
- * @author Matthias Braun
- */
-#ifndef BEVERIFY_H_
-#define BEVERIFY_H_
+#ifndef FIRM_BE_BEVERIFY_H
+#define FIRM_BE_BEVERIFY_H
#include "irgraph.h"
*/
int be_verify_out_edges(ir_graph *irg);
-#endif /* BEVERIFY_H_ */
+#endif /* FIRM_BE_BEVERIFY_H */