Commit eeeb88f4 authored by Michael Beck's avatar Michael Beck
Browse files

made get_Block_cfgpred() and get_Block_n_cfgpreds() inline

get_negated_pnc() now used the mode to supress unordered bit
on modes that do not have them.

[r6094]
parent 836bba57
...@@ -56,27 +56,14 @@ const char *get_pnc_string(int pnc) { ...@@ -56,27 +56,14 @@ const char *get_pnc_string(int pnc) {
/* /*
* Calculates the negated (Complement(R)) pnc condition. * Calculates the negated (Complement(R)) pnc condition.
*/ */
int int get_negated_pnc(int pnc, ir_mode *mode) {
get_negated_pnc(int pnc) { pnc ^= pn_Cmp_True;
switch (pnc) {
case pn_Cmp_False: return pn_Cmp_True; /* do NOT add the Uo bit for non-floating point values */
case pn_Cmp_Eq: return pn_Cmp_Ne; if (! mode_is_float(mode))
case pn_Cmp_Lt: return pn_Cmp_Uge; pnc &= ~pn_Cmp_Uo;
case pn_Cmp_Le: return pn_Cmp_Ug;
case pn_Cmp_Gt: return pn_Cmp_Ule; return pnc;
case pn_Cmp_Ge: return pn_Cmp_Ul;
case pn_Cmp_Lg: return pn_Cmp_Ue;
case pn_Cmp_Leg: return pn_Cmp_Uo;
case pn_Cmp_Uo: return pn_Cmp_Leg;
case pn_Cmp_Ue: return pn_Cmp_Lg;
case pn_Cmp_Ul: return pn_Cmp_Ge;
case pn_Cmp_Ule: return pn_Cmp_Gt;
case pn_Cmp_Ug: return pn_Cmp_Le;
case pn_Cmp_Uge: return pn_Cmp_Lt;
case pn_Cmp_Ne: return pn_Cmp_Eq;
case pn_Cmp_True: return pn_Cmp_False;
}
return 99; /* to shut up gcc */
} }
/* Calculates the inversed (R^-1) pnc condition, i.e., "<" --> ">" */ /* Calculates the inversed (R^-1) pnc condition, i.e., "<" --> ">" */
...@@ -615,16 +602,13 @@ get_Block_cfgpred_arr (ir_node *node) ...@@ -615,16 +602,13 @@ get_Block_cfgpred_arr (ir_node *node)
} }
int int
get_Block_n_cfgpreds (ir_node *node) { (get_Block_n_cfgpreds)(ir_node *node) {
assert ((node->op == op_Block)); return get_Block_n_cfgpreds(node);
return get_irn_arity(node);
} }
ir_node * ir_node *
get_Block_cfgpred (ir_node *node, int pos) { (get_Block_cfgpred)(ir_node *node, int pos) {
assert(-1 <= pos && pos < get_irn_arity(node)); return get_Block_cfgpred(node, pos);
assert(node->op == op_Block);
return get_irn_n(node, pos);
} }
void void
......
...@@ -252,6 +252,11 @@ void set_Block_matured (ir_node *node, bool matured); ...@@ -252,6 +252,11 @@ void set_Block_matured (ir_node *node, bool matured);
* @see also: get_irn_visited() inc_irg_visited() inc_irg_block_visited()*/ * @see also: get_irn_visited() inc_irg_visited() inc_irg_block_visited()*/
unsigned long get_Block_block_visited (ir_node *node); unsigned long get_Block_block_visited (ir_node *node);
void set_Block_block_visited (ir_node *node, unsigned long visit); void set_Block_block_visited (ir_node *node, unsigned long visit);
/**
* Marks a block as dead but do not replace it with a Bad node.
* Dead blocks are removed in the con
*/
ir_node *set_Block_dead(ir_node *block); ir_node *set_Block_dead(ir_node *block);
int is_Block_dead(const ir_node *block); int is_Block_dead(const ir_node *block);
...@@ -682,7 +687,7 @@ typedef enum { ...@@ -682,7 +687,7 @@ typedef enum {
const char *get_pnc_string(int pnc); const char *get_pnc_string(int pnc);
/** Calculates the negated (Complement(R)) pnc condition. */ /** Calculates the negated (Complement(R)) pnc condition. */
int get_negated_pnc(int pnc); int get_negated_pnc(int pnc, ir_mode *mode);
/** Calculates the inversed (R^-1) pnc condition, i.e., "<" --> ">" */ /** Calculates the inversed (R^-1) pnc condition, i.e., "<" --> ">" */
int get_inversed_pnc(int pnc); int get_inversed_pnc(int pnc);
......
...@@ -552,6 +552,19 @@ _is_Block(const ir_node *node) { ...@@ -552,6 +552,19 @@ _is_Block(const ir_node *node) {
return (_get_irn_op(node) == op_Block); return (_get_irn_op(node) == op_Block);
} }
static INLINE int
_get_Block_n_cfgpreds (ir_node *node) {
assert(_is_Block(node));
return _get_irn_arity(node);
}
static INLINE ir_node *
_get_Block_cfgpred (ir_node *node, int pos) {
assert(0 <= pos && pos < get_irn_arity(node));
assert(_is_Block(node));
return _get_irn_n(node, pos);
}
static INLINE unsigned long static INLINE unsigned long
_get_Block_block_visited (ir_node *node) { _get_Block_block_visited (ir_node *node) {
assert (node->op == op_Block); assert (node->op == op_Block);
...@@ -645,6 +658,8 @@ static INLINE type *_get_irn_type(ir_node *node) { ...@@ -645,6 +658,8 @@ static INLINE type *_get_irn_type(ir_node *node) {
#define is_Bad(node) _is_Bad(node) #define is_Bad(node) _is_Bad(node)
#define is_no_Block(node) _is_no_Block(node) #define is_no_Block(node) _is_no_Block(node)
#define is_Block(node) _is_Block(node) #define is_Block(node) _is_Block(node)
#define get_Block_n_cfgpreds(node) _get_Block_n_cfgpreds(node)
#define get_Block_cfgpred(node, pos) _get_Block_cfgpred(node, pos)
#define get_Block_block_visited(node) _get_Block_block_visited(node) #define get_Block_block_visited(node) _get_Block_block_visited(node)
#define set_Block_block_visited(node, visit) _set_Block_block_visited(node, visit) #define set_Block_block_visited(node, visit) _set_Block_block_visited(node, visit)
#define mark_Block_block_visited(node) _mark_Block_block_visited(node) #define mark_Block_block_visited(node) _mark_Block_block_visited(node)
......
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