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.

parent 836bba57
......@@ -56,27 +56,14 @@ const char *get_pnc_string(int pnc) {
* Calculates the negated (Complement(R)) pnc condition.
get_negated_pnc(int pnc) {
switch (pnc) {
case pn_Cmp_False: return pn_Cmp_True;
case pn_Cmp_Eq: return pn_Cmp_Ne;
case pn_Cmp_Lt: return pn_Cmp_Uge;
case pn_Cmp_Le: return pn_Cmp_Ug;
case pn_Cmp_Gt: return pn_Cmp_Ule;
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 */
int get_negated_pnc(int pnc, ir_mode *mode) {
pnc ^= pn_Cmp_True;
/* do NOT add the Uo bit for non-floating point values */
if (! mode_is_float(mode))
pnc &= ~pn_Cmp_Uo;
return pnc;
/* Calculates the inversed (R^-1) pnc condition, i.e., "<" --> ">" */
......@@ -615,16 +602,13 @@ get_Block_cfgpred_arr (ir_node *node)
get_Block_n_cfgpreds (ir_node *node) {
assert ((node->op == op_Block));
return get_irn_arity(node);
(get_Block_n_cfgpreds)(ir_node *node) {
return get_Block_n_cfgpreds(node);
ir_node *
get_Block_cfgpred (ir_node *node, int pos) {
assert(-1 <= pos && pos < get_irn_arity(node));
assert(node->op == op_Block);
return get_irn_n(node, pos);
(get_Block_cfgpred)(ir_node *node, int pos) {
return get_Block_cfgpred(node, pos);
......@@ -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()*/
unsigned long get_Block_block_visited (ir_node *node);
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);
int is_Block_dead(const ir_node *block);
......@@ -682,7 +687,7 @@ typedef enum {
const char *get_pnc_string(int pnc);
/** 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., "<" --> ">" */
int get_inversed_pnc(int pnc);
......@@ -552,6 +552,19 @@ _is_Block(const ir_node *node) {
return (_get_irn_op(node) == op_Block);
static INLINE int
_get_Block_n_cfgpreds (ir_node *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));
return _get_irn_n(node, pos);
static INLINE unsigned long
_get_Block_block_visited (ir_node *node) {
assert (node->op == op_Block);
......@@ -645,6 +658,8 @@ static INLINE type *_get_irn_type(ir_node *node) {
#define is_Bad(node) _is_Bad(node)
#define is_no_Block(node) _is_no_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 set_Block_block_visited(node, visit) _set_Block_block_visited(node, visit)
#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