2 * Internal headers for liveness analysis.
3 * @author Sebastian Hack
14 typedef struct _block_live_info_t {
19 typedef struct _node_live_info_t {
20 unsigned last_use_in_block : 1;
23 typedef struct _live_info_t {
25 block_live_info_t block;
26 node_live_info_t node;
30 extern size_t live_irn_data_offset;
32 #define get_irn_live_info(irn) get_irn_data(irn, live_info_t, live_irn_data_offset)
33 #define get_live_info_irn(inf) get_irn_data_base(inf, live_irn_data_offset)
35 #define get_block_live_info(irn) &(get_irn_live_info(irn)->v.block)
37 static INLINE int _is_live_in(const ir_node *block, const ir_node *irn)
39 block_live_info_t *info = get_block_live_info(block);
41 assert(is_Block(block) && "Need a block here");
42 return pset_find_ptr(info->in, irn) != NULL;
45 static INLINE int _is_live_out(const ir_node *block, const ir_node *irn)
47 block_live_info_t *info = get_block_live_info(block);
49 assert(is_Block(block) && "Need a block here");
50 return pset_find_ptr(info->out, irn) != NULL;
53 #define is_live_in(block,irn) _is_live_in(block, irn)
54 #define is_live_out(block,irn) _is_live_out(block, irn)
57 * Initialize the liveness module.
58 * To be called from be_init().
60 void be_liveness_init(void);