Commit 5dd864dc authored by Matthias Braun's avatar Matthias Braun
Browse files

move is_liveness_node to irlivechk header and share it with belive

parent 555593b0
......@@ -101,26 +101,6 @@ static bl_info_t *get_block_info(lv_chk_t *lv, const ir_node *block)
return info;
}
/**
* Filter function to select all nodes for which liveness is computed.
* @param irn A node.
* @return 1 if the node shall be considered in liveness, 0 if not.
*/
static inline int is_liveness_node(const ir_node *irn)
{
switch (get_irn_opcode(irn)) {
case iro_Block:
case iro_Bad:
case iro_End:
case iro_Anchor:
return 0;
default:
break;
}
return 1;
}
/**
* Compute the transitive closure on the reduced graph.
* The reduced graph is the original graph without back edges.
......
......@@ -33,6 +33,7 @@
#include "irgraph.h"
#include "irnode.h"
#include <stdbool.h>
typedef enum {
lv_chk_state_in = 1,
......@@ -43,6 +44,26 @@ typedef enum {
typedef struct lv_chk_t lv_chk_t;
/**
* Filter out some nodes for which we never need liveness.
*
* @param irn the node t check
* @return 0 if no liveness info is needed, 1 else
*/
static inline bool is_liveness_node(const ir_node *irn)
{
switch (get_irn_opcode(irn)) {
case iro_Block:
case iro_Bad:
case iro_End:
case iro_Anchor:
case iro_NoMem:
return 0;
default:
return 1;
}
}
/**
* Make a new liveness check environment.
* @param irg The graph.
......
......@@ -47,26 +47,6 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
#define LV_STD_SIZE 64
/**
* Filter out some nodes for which we never need liveness.
*
* @param irn the node t check
* @return 0 if no liveness info is needed, 1 else
*/
static inline int is_liveness_node(const ir_node *irn)
{
switch (get_irn_opcode(irn)) {
case iro_Block:
case iro_Bad:
case iro_End:
case iro_Anchor:
case iro_NoMem:
return 0;
default:
return 1;
}
}
int (be_is_live_in)(const be_lv_t *lv, const ir_node *block, const ir_node *irn)
{
return _be_is_live_xxx(lv, block, irn, be_lv_state_in);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment