2 * This file is part of libFirm.
3 * Copyright (C) 2012 Inria Rhone-Alpes.
8 * @author Sebastian Hack
12 * Live in/end checks whose only precomputation concerns the structure of the CFG.
13 * Hence, nothing has to be updated if the program is modified unless the CFG is touched.
14 * See .c file for more comments.
17 #ifndef FIRM_ANA_IRLIVECHK_H
18 #define FIRM_ANA_IRLIVECHK_H
28 lv_chk_state_through = lv_chk_state_in | lv_chk_state_out | lv_chk_state_end,
31 typedef struct lv_chk_t lv_chk_t;
34 * Filter out some nodes for which we never need liveness.
36 * @param irn the node t check
37 * @return 0 if no liveness info is needed, 1 else
39 static inline bool is_liveness_node(const ir_node *irn)
41 switch (get_irn_opcode(irn)) {
54 * Make a new liveness check environment.
55 * @param irg The graph.
56 * @return The environment.
58 extern lv_chk_t *lv_chk_new(ir_graph *irg);
61 * Free liveness check information.
62 * @param lv The liveness check information.
64 extern void lv_chk_free(lv_chk_t *lv);
68 * Return liveness information for a node concerning a block.
69 * @param lv The liveness environment.
70 * @param bl The block to investigate.
71 * @param irn The node to check for.
72 * @return A bitmask of <code>lv_chk_state_t</code>.
74 extern unsigned lv_chk_bl_xxx(lv_chk_t *lv, const ir_node *bl, const ir_node *irn);
76 #define lv_chk_bl_in(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_in) != 0)
77 #define lv_chk_bl_end(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_end) != 0)
78 #define lv_chk_bl_out(lv, bl, irn) ((lv_chk_bl_xxx((lv), (bl), (irn)) & lv_chk_state_out) != 0)
80 #endif /* FIRM_ANA_IRLIVECHK_H */