X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbera_t.h;h=5b83b8a4b31c97b2e86ecba25cd1a2a71b2f46f3;hb=83c9157ff224552a9b16a73fe4a16451f4963831;hp=f14875b8a003efd55a5e0f9102542482111707e3;hpb=5663da1d73944b6aae2bf6d38ef58e188ad76e1c;p=libfirm diff --git a/ir/be/bera_t.h b/ir/be/bera_t.h index f14875b8a..5b83b8a4b 100644 --- a/ir/be/bera_t.h +++ b/ir/be/bera_t.h @@ -4,23 +4,27 @@ * @date 8.12.2004 */ -#ifndef _BERA_H -#define _BERA_H +#ifndef _BERA_T_H +#define _BERA_T_H #include "firm_config.h" #include "bitset.h" +#include "list.h" #include "bera.h" #define DBG_BERA "firm.be.ra" typedef struct _ra_node_info_t { + ir_node *spill_location; /**< Spill location node of the node. + If NULL, the node is not spilled. */ int pressure; /**< Register pressure at this node. */ int color; /**< The color assigned to this node. */ } ra_node_info_t; typedef struct _ra_block_info_t { - bitset_t *used_colors; /**< A bitmask containing all colors used in the block. */ + bitset_t *used_colors; /**< A bitmask containing all colors used in the block. */ + struct list_head border_head; /**< A list head to enqueue the borders. */ } ra_block_info_t; /** @@ -39,6 +43,8 @@ typedef struct _ra_info_t { #define get_ra_node_info(the_node) (&get_ra_irn_info(the_node)->v.node) #define get_ra_block_info(the_block) (&get_ra_irn_info(the_block)->v.block) +#define get_block_border_head(bl) (&get_ra_block_info(bl)->border_head) + extern size_t ra_irn_data_offset; extern size_t ra_irg_data_offset; @@ -64,26 +70,39 @@ void be_ra_init(void); */ #define is_color(col) ((col) != NO_COLOR) -static INLINE int __get_irn_color(const ir_node *irn) +static INLINE int _get_irn_color(const ir_node *irn) { assert(!is_Block(irn) && "No block allowed here"); return get_ra_node_info(irn)->color; } -static INLINE void __set_irn_color(const ir_node *irn, int color) +static INLINE void _set_irn_color(const ir_node *irn, int color) { assert(!is_Block(irn) && "No block allowed here"); get_ra_node_info(irn)->color = color; } -static INLINE int __is_allocatable_irn(const ir_node *irn) +static INLINE int _is_allocatable_irn(const ir_node *irn) { assert(!is_Block(irn) && "No block allowed here"); return mode_is_datab(get_irn_mode(irn)); } -#define get_irn_color(irn) __get_irn_color(irn) -#define set_irn_color(irn,col) __set_irn_color(irn, col) -#define is_allocatable_irn(irn) __is_allocatable_irn(irn) +#define get_irn_color(irn) _get_irn_color(irn) +#define set_irn_color(irn,col) _set_irn_color(irn, col) +#define is_allocatable_irn(irn) _is_allocatable_irn(irn) + +static INLINE struct list_head *_get_block_border_head(ir_node *block) +{ + return &get_ra_block_info(block)->border_head; +} + +/** + * Check, if two phi operands interfere. + * @param a A node which is operand to a phi function. + * @param b Another node which is operand to a phi function. + * @return 1, if @p a and @p b interfere, 0 if not. + */ +int phi_ops_interfere(const ir_node *a, const ir_node *b); -#endif +#endif /* BERA_T_H */