Commit 81d4cf5a authored by Matthias Braun's avatar Matthias Braun
Browse files

- split array.h into array.h/array_t.h and make array.h independent of

  compiletime options like NDEBUG (as it is public API!)
- renamed some statevs (append a prefix for their module)

[r22329]
parent 032d138b
......@@ -35,10 +35,6 @@
#include "align.h"
#include "xmalloc.h"
#define ARR_D_MAGIC FOURCC('A','R','R','D')
#define ARR_A_MAGIC FOURCC('A','R','R','A')
#define ARR_F_MAGIC FOURCC('A','R','R','F')
/**
* Creates a flexible array.
*
......@@ -52,7 +48,7 @@
* first element of this array).
*/
#define NEW_ARR_F(type, nelts) \
((type *)_new_arr_f((nelts), sizeof(type) * (nelts)))
((type *)ir_new_arr_f((nelts), sizeof(type) * (nelts)))
/**
* Creates a new flexible array with the same number of elements as a
......@@ -90,7 +86,7 @@
*
* @param arr The flexible array.
*/
#define DEL_ARR_F(arr) (_del_arr_f((void *)(arr)))
#define DEL_ARR_F(arr) (ir_del_arr_f((void *)(arr)))
/**
* Creates a dynamic array on an obstack.
......@@ -107,7 +103,7 @@
*/
#define NEW_ARR_D(type, obstack, nelts) \
( nelts \
? (type *)_new_arr_d((obstack), (nelts), sizeof(type) * (nelts)) \
? (type *)ir_new_arr_d((obstack), (nelts), sizeof(type) * (nelts)) \
: (type *)arr_mt_descr.v.elts)
/**
......@@ -143,81 +139,12 @@
#define DUP_ARR_D(type, obstack, arr) \
memcpy(CLONE_ARR_D(type, (obstack), (arr)), (arr), sizeof(type) * ARR_LEN ((arr)))
/**
* Create an automatic array which will be deleted at return from function.
* Beware, the data will be allocated on the function stack!
*
* @param type The element type of the new array.
* @param var A lvalue of type (type *) which will hold the new array.
* @param n number of elements in this array.
*
* This macro creates a dynamic array on the functions stack of a given type at runtime.
* The size of the array cannot be changed later.
*/
#define NEW_ARR_A(type, var, n) \
do { \
int _nelts = (n); \
assert(_nelts >= 0); \
(var) = (void *)((_arr_descr *)alloca(_ARR_ELTS_OFFS + sizeof(type) * _nelts))->v.elts; \
_ARR_SET_DBGINF(_ARR_DESCR ((var)), ARR_A_MAGIC, sizeof (type)); \
(void)(_ARR_DESCR((var))->nelts = _nelts); \
} while (0)
/**
* Creates a new automatic array with the same number of elements as a
* given one.
*
* @param type The element type of the new array.
* @param var A lvalue of type (type *) which will hold the new array.
* @param arr An array from which the elements will be duplicated
*
* This macro creates a dynamic array of a given type at runtime.
* The size of the array cannot be changed later.
*
* @return A pointer to the dynamic array (can be used as a pointer to the
* first element of this array).
*/
#define CLONE_ARR_A(type, var, arr) \
NEW_ARR_A(type, (var), ARR_LEN((arr)))
/**
* Duplicates an array and returns a new automatic one.
*
* @param type The element type of the new array.
* @param var A lvalue of type (type *) which will hold the new array.
* @param arr An array from with the number of elements will be taken
*
* This macro creates a dynamic array of a given type at runtime.
* The size of the array cannot be changed later.
*
* @return A pointer to the dynamic array (can be used as a pointer to the
* first element of this array).
*/
#define DUP_ARR_A(type, var, arr) \
do { CLONE_ARR_A(type, (var), (arr)); \
memcpy((var), (arr), sizeof (type) * ARR_LEN((arr))); } \
while (0)
/**
* Declare an initialized (zero'ed) array of fixed size.
* This macro should be used at file scope only.
*
* @param type The element type of the new array.
* @param var A lvalue of type (type *) which will hold the new array.
* @param _nelts Number of elements in this new array.
*/
#define DECL_ARR_S(type, var, _nelts) \
ARR_STRUCT(type, (_nelts) ? (_nelts) : 1) _##var; \
type *var = (_ARR_SET_DBGINF(&_##var, ARR_A_MAGIC, sizeof (type)), \
_##var.nelts = _nelts, \
_##var.v.elts)
/**
* Returns the length of an array
*
* @param arr a flexible, dynamic, automatic or static array.
*/
#define ARR_LEN(arr) (ARR_VRFY((arr)), _ARR_DESCR((arr))->nelts)
#define ARR_LEN(arr) (ARR_VRFY((arr)), ARR_DESCR((arr))->nelts)
/**
* Resize a flexible array, allocate more data if needed but do NOT
......@@ -230,7 +157,7 @@
* @remark This macro may change arr, so update all references!
*/
#define ARR_RESIZE(type, arr, n) \
((arr) = _arr_resize((void *)(arr), (n), sizeof(type)))
((arr) = ir_arr_resize((void *)(arr), (n), sizeof(type)))
/**
* Resize a flexible array, always reallocate data.
......@@ -242,13 +169,13 @@
* @remark This macro may change arr, so update all references!
*/
#define ARR_SETLEN(type, arr, n) \
((arr) = _arr_setlen((void *)(arr), (n), sizeof(type) * (n)))
((arr) = ir_arr_setlen((void *)(arr), (n), sizeof(type) * (n)))
/** Set a length smaller than the current length of the array. Do not
* resize. len must be <= ARR_LEN(arr). */
#define ARR_SHRINKLEN(arr,len) \
(ARR_VRFY((arr)), assert(_ARR_DESCR((arr))->nelts >= len), \
_ARR_DESCR((arr))->nelts = len)
(ARR_VRFY((arr)), assert(ARR_DESCR((arr))->nelts >= len), \
ARR_DESCR((arr))->nelts = len)
/**
* Resize a flexible array by growing it by delta elements.
......@@ -286,65 +213,49 @@
(ARR_EXTEND(type, (arr), 1), (arr)[ARR_LEN((arr))-1] = (elt))
#ifdef NDEBUG
# define ARR_VRFY(arr) ((void)0)
# define ARR_VRFY(arr) ((void)0)
# define ARR_IDX_VRFY(arr, idx) ((void)0)
#else
# define ARR_VRFY(arr) \
assert ( ( (_ARR_DESCR((arr))->magic == ARR_D_MAGIC) \
|| (_ARR_DESCR((arr))->magic == ARR_A_MAGIC) \
|| (_ARR_DESCR((arr))->magic == ARR_F_MAGIC)) \
&& ( (_ARR_DESCR((arr))->magic != ARR_F_MAGIC) \
|| (_ARR_DESCR((arr))->u.allocated >= _ARR_DESCR((arr))->nelts)) \
&& (_ARR_DESCR((arr))->nelts >= 0))
# define ARR_VRFY(arr) ir_verify_arr(arr)
# define ARR_IDX_VRFY(arr, idx) \
assert((0 <= (idx)) && ((idx) < ARR_LEN((arr))))
#endif
/* Private !!!
Don't try this at home, kids, we're trained professionals ;->
... or at the IPD, either. */
#ifdef NDEBUG
# define _ARR_DBGINF_DECL
# define _ARR_SET_DBGINF(descr, co, es)
#else
# define _ARR_DBGINF_DECL int magic; size_t eltsize;
# define _ARR_SET_DBGINF(descr, co, es) \
( (descr)->magic = (co), (descr)->eltsize = (es) )
#endif
/**
* Construct an array header.
*/
#define ARR_STRUCT(type, _nelts) \
struct { \
_ARR_DBGINF_DECL \
union { \
struct obstack *obstack; /* dynamic: allocated on this obstack */ \
int allocated; /* flexible: #slots allocated */ \
} u; \
int nelts; \
union { \
type elts[(_nelts)]; \
aligned_type align[1]; \
} v; \
#define ARR_STRUCT(type, rnelts) \
struct { \
int magic; \
size_t eltsize; \
union { \
struct obstack *obstack; /* dynamic: allocated on this obstack */ \
int allocated; /* flexible: #slots allocated */ \
} u; \
int nelts; \
union { \
type elts[(rnelts)]; \
aligned_type align[1]; \
} v; \
}
/**
* The array descriptor header type.
*/
typedef ARR_STRUCT(aligned_type, 1) _arr_descr;
typedef ARR_STRUCT(aligned_type, 1) ir_arr_descr;
extern _arr_descr arr_mt_descr;
extern ir_arr_descr arr_mt_descr;
void *_new_arr_f(int nelts, size_t elts_size);
void _del_arr_f(void *elts);
void *_new_arr_d(struct obstack *obstack, int nelts, size_t elts_size);
void *_arr_resize(void *elts, int nelts, size_t elts_size);
void *_arr_setlen(void *elts, int nelts, size_t elts_size);
void *ir_new_arr_f(int nelts, size_t elts_size);
void ir_del_arr_f(void *elts);
void *ir_new_arr_d(struct obstack *obstack, int nelts, size_t elts_size);
void *ir_arr_resize(void *elts, int nelts, size_t elts_size);
void *ir_arr_setlen(void *elts, int nelts, size_t elts_size);
void ir_verify_arr(const void *elts);
#define _ARR_ELTS_OFFS offsetof(_arr_descr, v.elts)
#define _ARR_DESCR(elts) ((_arr_descr *)(void *)((char *)(elts) - _ARR_ELTS_OFFS))
#define ARR_ELTS_OFFS offsetof(ir_arr_descr, v.elts)
#define ARR_DESCR(elts) ((ir_arr_descr *)(void *)((char *)(elts) - ARR_ELTS_OFFS))
/*
____ _ _ _
......@@ -355,7 +266,7 @@ void *_arr_setlen(void *elts, int nelts, size_t elts_size);
|___/
*/
typedef int (_arr_cmp_func_t)(const void *a, const void *b);
typedef int (ir_arr_cmp_func_t)(const void *a, const void *b);
/**
* Do a binary search in an array.
......@@ -373,7 +284,7 @@ typedef int (_arr_cmp_func_t)(const void *a, const void *b);
* in the case that the element is not conatined in the array.
*/
static INLINE __attribute__((const, unused)) int
_arr_bsearch(const void *arr, size_t elm_size, _arr_cmp_func_t *cmp, const void *elm)
ir_arr_bsearch(const void *arr, size_t elm_size, ir_arr_cmp_func_t *cmp, const void *elm)
{
int hi = ARR_LEN(arr);
int lo = 0;
......@@ -394,18 +305,18 @@ _arr_bsearch(const void *arr, size_t elm_size, _arr_cmp_func_t *cmp, const void
#define ARR_SET_INSERT(arr, cmp, elm) \
do { \
int idx = _arr_bsearch((arr), sizeof((arr)[0]), (cmp), (elm)); \
int idx = ir_arr_bsearch((arr), sizeof((arr)[0]), (cmp), (elm)); \
if (idx < 0) { \
idx = -idx - 1; \
memmove(&(arr)[idx+1], &(arr)[idx], sizeof((arr)[0]) * (_ARR_DESCR((arr))->nelts - idx)); \
memmove(&(arr)[idx+1], &(arr)[idx], sizeof((arr)[0]) * (ARR_DESCR((arr))->nelts - idx)); \
(arr)[idx] = *(elm); \
++_ARR_DESCR((arr))->nelts; \
++ARR_DESCR((arr))->nelts; \
} \
} while(0)
#define ARR_SET_INSERT_EXT(type, arr, cmp, elm) \
do { \
int idx = _arr_bsearch((arr), sizeof((arr)[0]), (cmp), (elm)); \
int idx = ir_arr_bsearch((arr), sizeof((arr)[0]), (cmp), (elm)); \
if (idx < 0) { \
int len = ARR_LEN(arr); \
idx = -idx - 1; \
......@@ -417,10 +328,10 @@ do { \
#define ARR_SET_REMOVE(arr, cmp, elm) \
do { \
int idx = _arr_bsearch((arr), sizeof((arr)[0]), (cmp), (elm)); \
int idx = ir_arr_bsearch((arr), sizeof((arr)[0]), (cmp), (elm)); \
if (idx >= 0) { \
--_ARR_DESCR((arr))->nelts; \
memmove(&(arr)[idx], &(arr)[idx+1], sizeof((arr)[0]) * (_ARR_DESCR((arr))->nelts - idx)); \
--ARR_DESCR((arr))->nelts; \
memmove(&(arr)[idx], &(arr)[idx+1], sizeof((arr)[0]) * (ARR_DESCR((arr))->nelts - idx)); \
} \
} while(0)
......@@ -432,7 +343,7 @@ do { \
* @return The index or some value < 0 if the element was not in the set.
*/
#define ARR_SET_GET_IDX(arr, cmp, elm) \
(ARR_VRFY((arr)), _arr_bsearch((arr), sizeof((arr)[0]), cmp, (elm)))
(ARR_VRFY((arr)), ir_arr_bsearch((arr), sizeof((arr)[0]), cmp, (elm)))
#ifdef __GNUC__
#define ARR_SET_GET(arr, cmp, elm) \
......
......@@ -32,7 +32,7 @@
# include <stdlib.h>
#endif
#include "array.h"
#include "array_t.h"
#include "xmalloc.h"
/* Undefine the macros to get the functions instead, cf tmalloc.c. */
......@@ -51,11 +51,22 @@
/**
* An empty dynamic array descriptor.
*/
_arr_descr arr_mt_descr
ir_arr_descr arr_mt_descr = { ARR_D_MAGIC, 0, {0}, 0, {{{0}}} };
void ir_verify_arr(const void *arr)
{
#ifndef NDEBUG
= { ARR_D_MAGIC, 0, {0}, 0, {{{0}}} }
ir_arr_descr *descr = ARR_DESCR(arr);
assert(descr->magic == ARR_D_MAGIC || descr->magic == ARR_A_MAGIC
|| descr->magic == ARR_F_MAGIC);
if (descr->magic == ARR_F_MAGIC) {
assert(descr->u.allocated >= descr->nelts);
}
assert(descr->nelts >= 0);
#else
(void) arr;
#endif
;
}
/**
* Creates a dynamic array on a obstack.
......@@ -69,13 +80,13 @@ _arr_descr arr_mt_descr
*
* @remark Helper function, use NEW_ARR_D() instead.
*/
void *_new_arr_d(struct obstack *obstack, int nelts, size_t elts_size) {
_arr_descr *dp;
void *ir_new_arr_d(struct obstack *obstack, int nelts, size_t elts_size) {
ir_arr_descr *dp;
assert(obstack && (nelts >= 0));
dp = obstack_alloc(obstack, _ARR_ELTS_OFFS + elts_size);
_ARR_SET_DBGINF(dp, ARR_D_MAGIC, elts_size/nelts);
dp = obstack_alloc(obstack, ARR_ELTS_OFFS + elts_size);
ARR_SET_DBGINF(dp, ARR_D_MAGIC, elts_size/nelts);
dp->u.obstack = obstack;
dp->nelts = nelts;
return dp->v.elts;
......@@ -92,12 +103,12 @@ void *_new_arr_d(struct obstack *obstack, int nelts, size_t elts_size) {
*
* @remark Helper function, use NEW_ARR_F() instead.
*/
void *_new_arr_f(int nelts, size_t elts_size) {
_arr_descr *new;
void *ir_new_arr_f(int nelts, size_t elts_size) {
ir_arr_descr *new;
assert (nelts >= 0);
new = xmalloc (_ARR_ELTS_OFFS+elts_size);
_ARR_SET_DBGINF (new, ARR_F_MAGIC, nelts ? elts_size/nelts : 0);
new = xmalloc (ARR_ELTS_OFFS+elts_size);
ARR_SET_DBGINF (new, ARR_F_MAGIC, nelts ? elts_size/nelts : 0);
new->u.allocated = new->nelts = nelts;
return new->v.elts;
}
......@@ -109,15 +120,15 @@ void *_new_arr_f(int nelts, size_t elts_size) {
*
* @remark Helper function, use DEL_ARR_F() instead.
*/
void _del_arr_f(void *elts) {
_arr_descr *dp = _ARR_DESCR (elts);
void ir_del_arr_f(void *elts) {
ir_arr_descr *dp = ARR_DESCR (elts);
ARR_VRFY (elts);
assert (dp->magic == ARR_F_MAGIC);
#ifndef NDEBUG
{
_arr_descr *wdp = (_arr_descr *)dp;
ir_arr_descr *wdp = (ir_arr_descr *)dp;
wdp->magic = 0xdeadbeef;
}
#endif
......@@ -136,14 +147,14 @@ void _del_arr_f(void *elts) {
*
* @remark Helper function, use ARR_SETLEN() instead.
*/
void *_arr_setlen (void *elts, int nelts, size_t elts_size) {
_arr_descr *dp = _ARR_DESCR (elts);
void *ir_arr_setlen (void *elts, int nelts, size_t elts_size) {
ir_arr_descr *dp = ARR_DESCR (elts);
assert ((dp->magic == ARR_F_MAGIC) && (nelts >= 0));
ARR_VRFY (elts);
assert (!dp->eltsize || !nelts || (dp->eltsize == elts_size/nelts));
dp = xrealloc (dp, _ARR_ELTS_OFFS+elts_size);
dp = xrealloc (dp, ARR_ELTS_OFFS+elts_size);
dp->u.allocated = dp->nelts = nelts;
return dp->v.elts;
......@@ -162,8 +173,8 @@ void *_arr_setlen (void *elts, int nelts, size_t elts_size) {
*
* @remark Helper function, use ARR_RESIZE() instead.
*/
void *_arr_resize(void *elts, int nelts, size_t eltsize) {
_arr_descr *dp = _ARR_DESCR(elts);
void *ir_arr_resize(void *elts, int nelts, size_t eltsize) {
ir_arr_descr *dp = ARR_DESCR(elts);
int n;
assert((dp->magic == ARR_F_MAGIC) && (nelts >= 0));
......@@ -177,7 +188,7 @@ void *_arr_resize(void *elts, int nelts, size_t eltsize) {
assert(n >= nelts);
if (n != dp->u.allocated) {
dp = xrealloc(dp, _ARR_ELTS_OFFS+eltsize*n);
dp = xrealloc(dp, ARR_ELTS_OFFS+eltsize*n);
dp->u.allocated = n;
#if defined(DEBUG) && defined(HAVE_GNU_MALLOC)
} else {
......@@ -204,9 +215,9 @@ int array_len(const void *arr) {
* Do NOT use is in code!.
* This function is intended to be called from a debugger.
*/
_arr_descr *array_descr(const void *arr) {
ir_arr_descr *array_descr(const void *arr) {
if (! arr)
return NULL;
return _ARR_DESCR(arr);
return ARR_DESCR(arr);
}
#endif /* DEBUG_libfirm */
......@@ -34,7 +34,7 @@
#include "irouts.h"
#include "irnode_t.h"
#include "irmode_t.h"
#include "array.h"
#include "array_t.h"
#include "irprog.h"
#include "entity_t.h"
#include "xmalloc.h"
......
......@@ -38,6 +38,7 @@
#include "irprintf.h"
#include "irgopt.h"
#include "irtools.h"
#include "array_t.h"
/**
* Walker environment.
......
......@@ -40,7 +40,7 @@
#include "irgraph_t.h" /* To access state field. */
#include "irnode_t.h"
#include "ircons_t.h"
#include "array.h"
#include "array_t.h"
#include "iredges.h"
......
......@@ -43,6 +43,7 @@
#include "bitset.h"
#include "debug.h"
#include "array_t.h"
#include "irtools.h"
#include "../bearch_t.h" /* the general register allocator interface */
......
......@@ -339,7 +339,7 @@ static void pre_spill(post_spill_env_t *pse, const arch_register_class_t *cls)
stat_ev_ctx_push_str("bechordal_cls", pse->cls->name);
stat_ev_do(node_stats(birg, pse->cls, &node_stat));
stat_ev_do(pse->pre_spill_cost = be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq));
stat_ev_dbl("phis_before_spill", node_stat.n_phis);
stat_ev_dbl("bechordal_phis_before_spill", node_stat.n_phis);
/* put all ignore registers into the ignore register set. */
be_put_ignore_regs(birg, pse->cls, chordal_env->ignore_colors);
......@@ -370,11 +370,11 @@ static void post_spill(post_spill_env_t *pse, int iteration) {
stat_ev_ctx_push_str("bechordal_cls", pse->cls->name);
stat_ev_do(node_stats(birg, pse->cls, &node_stat));
stat_ev_dbl("phis_after_spill", node_stat.n_phis);
stat_ev_dbl("mem_phis", node_stat.n_mem_phis);
stat_ev_dbl("reloads", node_stat.n_reloads);
stat_ev_dbl("spills", node_stat.n_spills);
stat_ev_dbl("spillcosts", be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq) - pse->pre_spill_cost);
stat_ev_dbl("bechordal_phis_after_spill", node_stat.n_phis);
stat_ev_dbl("bechordal_mem_phis", node_stat.n_mem_phis);
stat_ev_dbl("bechordal_reloads", node_stat.n_reloads);
stat_ev_dbl("bechordal_spills", node_stat.n_spills);
stat_ev_dbl("bechordal_spillcosts", be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq) - pse->pre_spill_cost);
/*
If we have a backend provided spiller, post spill is
......@@ -417,13 +417,13 @@ static void post_spill(post_spill_env_t *pse, int iteration) {
be_ifg_stat_t stat;
stat_ev_do(be_ifg_stat(birg, chordal_env->ifg, &stat));
stat_ev_dbl("ifg_nodes", stat.n_nodes);
stat_ev_dbl("ifg_edges", stat.n_edges);
stat_ev_dbl("ifg_comps", stat.n_comps);
stat_ev_dbl("bechordal_ifg_nodes", stat.n_nodes);
stat_ev_dbl("bechordal_ifg_edges", stat.n_edges);
stat_ev_dbl("bechordal_ifg_comps", stat.n_comps);
stat_ev_do(node_stats(birg, pse->cls, &node_stat));
stat_ev_dbl("perms_before_coal", node_stat.n_perms);
stat_ev_dbl("copies_before_coal", node_stat.n_copies);
stat_ev_dbl("bechordal_perms_before_coal", node_stat.n_perms);
stat_ev_dbl("bechordal_copies_before_coal", node_stat.n_copies);
}
/* copy minimization */
......@@ -436,9 +436,7 @@ static void post_spill(post_spill_env_t *pse, int iteration) {
/* ssa destruction */
BE_TIMER_PUSH(t_ra_ssa);
stat_ev_ctx_push_str("berachordal_phase", "ssadestr");
be_ssa_destruction(chordal_env);
stat_ev_ctx_pop("berachordal_phase");
BE_TIMER_POP(t_ra_ssa);
dump(BE_CH_DUMP_SSADESTR, irg, pse->cls, "-ssadestr", dump_ir_block_graph_sched);
......@@ -450,8 +448,8 @@ static void post_spill(post_spill_env_t *pse, int iteration) {
}
stat_ev_do(node_stats(birg, pse->cls, &node_stat));
stat_ev_dbl("perms_after_coal", node_stat.n_perms);
stat_ev_dbl("copies_after_coal", node_stat.n_copies);
stat_ev_dbl("bechordal_perms_after_coal", node_stat.n_perms);
stat_ev_dbl("bechordal_copies_after_coal", node_stat.n_copies);
stat_ev_ctx_pop("bechordal_cls");
/* the ifg exists only if there are allocatable regs */
......@@ -499,7 +497,7 @@ static void be_ra_chordal_main(be_irg_t *birg)
BE_TIMER_POP(t_ra_prolog);
stat_ev_if {
be_stat_ev("insns_before", count_insns(irg));
be_stat_ev("bechordal_insns_before", count_insns(irg));
}
if (! arch_code_generator_has_spiller(birg->cg)) {
......@@ -567,7 +565,7 @@ static void be_ra_chordal_main(be_irg_t *birg)
BE_TIMER_POP(t_ra_other);
stat_ev_if {
be_stat_ev("insns_after", count_insns(irg));
be_stat_ev("bechordal_insns_after", count_insns(irg));
}
}
......
......@@ -38,6 +38,7 @@
#include "irgmod.h"
#include "iredges_t.h"
#include "irgwalk.h"
#include "array_t.h"
#include "bearch_t.h"
#include "belower.h"
......
......@@ -531,29 +531,29 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
be_timing = (be_options.timing == BE_TIME_ON);
if (be_timing) {
t_abi = ir_timer_register("time_beabi", "be abi introduction");
t_codegen = ir_timer_register("time_codegen", "codegeneration");
t_sched = ir_timer_register("time_sched", "scheduling");
t_constr = ir_timer_register("time_constr", "assure constraints");
t_finish = ir_timer_register("time_finish", "graph finish");
t_emit = ir_timer_register("time_emiter", "code emiter");
t_verify = ir_timer_register("time_verify", "graph verification");
t_other = ir_timer_register("time_other", "other");
t_heights = ir_timer_register("time_heights", "heights");
t_live = ir_timer_register("time_liveness", "be liveness");
t_execfreq = ir_timer_register("time_execfreq", "execfreq");
t_ssa_constr = ir_timer_register("time_ssa_constr", "ssa reconstruction");
t_ra_prolog = ir_timer_register("time_ra_prolog", "regalloc prolog");
t_ra_epilog = ir_timer_register("time_ra_epilog", "regalloc epilog");
t_ra_constr = ir_timer_register("time_ra_constr", "regalloc constraints");
t_ra_spill = ir_timer_register("time_ra_spill", "spiller");
t_abi = ir_timer_register("bemain_time_beabi", "be abi introduction");
t_codegen = ir_timer_register("bemain_time_codegen", "codegeneration");
t_sched = ir_timer_register("bemain_time_sched", "scheduling");
t_constr = ir_timer_register("bemain_time_constr", "assure constraints");
t_finish = ir_timer_register("bemain_time_finish", "graph finish");
t_emit = ir_timer_register("bemain_time_emiter", "code emiter");
t_verify = ir_timer_register("bemain_time_verify", "graph verification");
t_other = ir_timer_register("bemain_time_other", "other");
t_heights = ir_timer_register("bemain_time_heights", "heights");
t_live = ir_timer_register("bemain_time_liveness", "be liveness");
t_execfreq = ir_timer_register("bemain_time_execfreq", "execfreq");
t_ssa_constr = ir_timer_register("bemain_time_ssa_constr", "ssa reconstruction");
t_ra_prolog = ir_timer_register("bemain_time_ra_prolog", "regalloc prolog");
t_ra_epilog = ir_timer_register("bemain_time_ra_epilog", "regalloc epilog");
t_ra_constr = ir_timer_register("bemain_time_ra_constr", "regalloc constraints");
t_ra_spill = ir_timer_register("bemain_time_ra_spill", "spiller");
t_ra_spill_apply
= ir_timer_register("time_ra_spill_apply", "apply spills");
t_ra_color = ir_timer_register("time_ra_color", "graph coloring");
t_ra_ifg = ir_timer_register("time_ra_ifg", "interference graph");
t_ra_copymin = ir_timer_register("time_ra_copymin", "copy minimization");
t_ra_ssa = ir_timer_register("time_ra_ssadestr", "ssa destruction");
t_ra_other = ir_timer_register("time_ra_other", "regalloc other");
= ir_timer_register("bemain_time_ra_spill_apply", "apply spills");
t_ra_color = ir_timer_register("bemain_time_ra_color", "graph coloring");
t_ra_ifg = ir_timer_register("bemain_time_ra_ifg", "interference graph");
t_ra_copymin = ir_timer_register("bemain_time_ra_copymin", "copy minimization");
t_ra_ssa = ir_timer_register("bemain_time_ra_ssadestr", "ssa destruction");
t_ra_other = ir_timer_register("bemain_time_ra_other", "regalloc other");
}
be_init_env(&env, file_handle);
......@@ -564,7 +564,8 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
arch_env = env.arch_env;
/* backend may provide an ordered list of irgs where code should be generated for */
/* backend may provide an ordered list of irgs where code should be
* generated for */
irg_list = NEW_ARR_F(ir_graph *, 0);
backend_irg_list = arch_env_get_backend_irg_list(arch_env, &irg_list);
......@@ -609,12 +610,6 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
/* set the current graph (this is important for several firm functions) */
current_ir_graph = irg;
#if 0
{
unsigned percent = 100*i/num_birgs;