From 6dd417e1838c9319956dd3a658791ce413099b7f Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Sun, 2 Jul 2006 16:16:53 +0000 Subject: [PATCH] Add strict flag to Conv attributes alloweing to mark those Conv's that should remain due to strict fp rounding rules. Removed unused Start attibutes. Renamed attribute names to more understandable names. [r7982] --- ir/ir/ircons.c | 62 ++++++++++++++++++++---------------- ir/ir/ircons.h | 25 +++++++++++++-- ir/ir/irdump.c | 5 +++ ir/ir/irnode.c | 83 +++++++++++++++++++++++++++--------------------- ir/ir/irnode.h | 4 ++- ir/ir/irnode_t.h | 72 ++++++++++++++++++++--------------------- ir/ir/irop.c | 4 +-- 7 files changed, 148 insertions(+), 107 deletions(-) diff --git a/ir/ir/ircons.c b/ir/ir/ircons.c index 02903caa7..b492c657a 100644 --- a/ir/ir/ircons.c +++ b/ir/ir/ircons.c @@ -328,19 +328,20 @@ new_bd_defaultProj (dbg_info *db, ir_node *block, ir_node *arg, ir_graph *irg = current_ir_graph; assert(arg->op == op_Cond); - arg->attr.c.kind = fragmentary; - arg->attr.c.default_proj = max_proj; + arg->attr.cond.kind = fragmentary; + arg->attr.cond.default_proj = max_proj; res = new_rd_Proj (db, irg, block, arg, mode_X, max_proj); return res; } static ir_node * -new_bd_Conv (dbg_info *db, ir_node *block, ir_node *op, ir_mode *mode) +new_bd_Conv (dbg_info *db, ir_node *block, ir_node *op, ir_mode *mode, int strict_flag) { ir_node *res; ir_graph *irg = current_ir_graph; res = new_ir_node(db, irg, block, op_Conv, mode, 1, &op); + res->attr.conv.strict = strict_flag; res = optimize_node(res); IRN_VRFY_IRG(res, irg); return res; @@ -441,9 +442,9 @@ new_bd_Cond (dbg_info *db, ir_node *block, ir_node *c) ir_graph *irg = current_ir_graph; res = new_ir_node (db, irg, block, op_Cond, mode_T, 1, &c); - res->attr.c.kind = dense; - res->attr.c.default_proj = 0; - res->attr.c.pred = COND_JMP_PRED_NONE; + res->attr.cond.kind = dense; + res->attr.cond.default_proj = 0; + res->attr.cond.pred = COND_JMP_PRED_NONE; res = optimize_node (res); IRN_VRFY_IRG(res, irg); return res; @@ -543,9 +544,9 @@ new_bd_Alloc (dbg_info *db, ir_node *block, ir_node *store, in[0] = store; in[1] = size; res = new_ir_node(db, irg, block, op_Alloc, mode_T, 2, in); - res->attr.a.exc.pin_state = op_pin_state_pinned; - res->attr.a.where = where; - res->attr.a.type = alloc_type; + res->attr.alloc.exc.pin_state = op_pin_state_pinned; + res->attr.alloc.where = where; + res->attr.alloc.type = alloc_type; res = optimize_node(res); IRN_VRFY_IRG(res, irg); return res; @@ -563,8 +564,8 @@ new_bd_Free (dbg_info *db, ir_node *block, ir_node *store, in[1] = ptr; in[2] = size; res = new_ir_node (db, irg, block, op_Free, mode_M, 3, in); - res->attr.f.where = where; - res->attr.f.type = free_type; + res->attr.free.where = where; + res->attr.free.type = free_type; res = optimize_node(res); IRN_VRFY_IRG(res, irg); return res; @@ -590,7 +591,7 @@ new_bd_Sel (dbg_info *db, ir_node *block, ir_node *store, ir_node *objptr, * FIXM: Sel's can select functions which should be of mode mode_P_code. */ res = new_ir_node(db, irg, block, op_Sel, mode_P_data, r_arity, r_in); - res->attr.s.ent = ent; + res->attr.sel.ent = ent; res = optimize_node(res); IRN_VRFY_IRG(res, irg); return res; @@ -610,9 +611,9 @@ new_bd_SymConst_type (dbg_info *db, ir_node *block, symconst_symbol value, res = new_ir_node(db, irg, block, op_SymConst, mode, 0, NULL); - res->attr.i.num = symkind; - res->attr.i.sym = value; - res->attr.i.tp = tp; + res->attr.symc.num = symkind; + res->attr.symc.sym = value; + res->attr.symc.tp = tp; res = optimize_node(res); IRN_VRFY_IRG(res, irg); @@ -818,7 +819,7 @@ new_bd_InstOf (dbg_info *db, ir_node *block, ir_node *store, in[0] = store; in[1] = objptr; res = new_ir_node(db, irg, block, op_Sel, mode_T, 2, in); - res->attr.io.type = type; + res->attr.instof.type = type; res = optimize_node(res); IRN_VRFY_IRG(res, irg); return res; @@ -999,7 +1000,7 @@ new_rd_Conv (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *op, ir_mode * ir_graph *rem = current_ir_graph; current_ir_graph = irg; - res = new_bd_Conv(db, block, op, mode); + res = new_bd_Conv(db, block, op, mode, 0); current_ir_graph = rem; return res; @@ -2247,7 +2248,7 @@ get_frag_arr (ir_node *n) { case iro_Call: return n->attr.call.exc.frag_arr; case iro_Alloc: - return n->attr.a.exc.frag_arr; + return n->attr.alloc.exc.frag_arr; case iro_Load: return n->attr.load.exc.frag_arr; case iro_Store: @@ -2622,27 +2623,29 @@ new_d_defaultProj (dbg_info *db, ir_node *arg, long max_proj) { ir_node *res; assert(arg->op == op_Cond); - arg->attr.c.kind = fragmentary; - arg->attr.c.default_proj = max_proj; + arg->attr.cond.kind = fragmentary; + arg->attr.cond.default_proj = max_proj; res = new_Proj (arg, mode_X, max_proj); return res; } ir_node * -new_d_Conv (dbg_info *db, ir_node *op, ir_mode *mode) -{ - return new_bd_Conv(db, current_ir_graph->current_block, op, mode); +new_d_Conv (dbg_info *db, ir_node *op, ir_mode *mode) { + return new_bd_Conv(db, current_ir_graph->current_block, op, mode, 0); } ir_node * -new_d_Cast (dbg_info *db, ir_node *op, ir_type *to_tp) -{ +new_d_strictConv (dbg_info *db, ir_node *op, ir_mode *mode) { + return new_bd_Conv(db, current_ir_graph->current_block, op, mode, 1); +} + +ir_node * +new_d_Cast (dbg_info *db, ir_node *op, ir_type *to_tp) { return new_bd_Cast(db, current_ir_graph->current_block, op, to_tp); } ir_node * -new_d_Tuple (dbg_info *db, int arity, ir_node **in) -{ +new_d_Tuple (dbg_info *db, int arity, ir_node **in) { return new_bd_Tuple(db, current_ir_graph->current_block, arity, in); } @@ -2807,7 +2810,7 @@ new_d_Alloc (dbg_info *db, ir_node *store, ir_node *size, ir_type *alloc_type, res = new_bd_Alloc (db, current_ir_graph->current_block, store, size, alloc_type, where); #if PRECISE_EXC_CONTEXT - allocate_frag_arr(res, op_Alloc, &res->attr.a.exc.frag_arr); /* Could be optimized away. */ + allocate_frag_arr(res, op_Alloc, &res->attr.alloc.exc.frag_arr); /* Could be optimized away. */ #endif return res; @@ -3264,6 +3267,9 @@ ir_node *new_Cmp (ir_node *op1, ir_node *op2) { ir_node *new_Conv (ir_node *op, ir_mode *mode) { return new_d_Conv(NULL, op, mode); } +ir_node *new_strictConv (ir_node *op, ir_mode *mode) { + return new_d_strictConv(NULL, op, mode); +} ir_node *new_Cast (ir_node *op, ir_type *to_tp) { return new_d_Cast(NULL, op, to_tp); } diff --git a/ir/ir/ircons.h b/ir/ir/ircons.h index c665f569f..d97442c6c 100644 --- a/ir/ir/ircons.h +++ b/ir/ir/ircons.h @@ -13,7 +13,7 @@ /** @todo - Ideas for imrovement: + Ideas for improvement: -# Handle construction of exceptions more comfortable: Add new constructors that pass the exception region (or better the Phi for the memories, the ex. region can be found from there) as parameter, @@ -3134,6 +3134,16 @@ ir_node *new_d_Cmp (dbg_info *db, ir_node *op1, ir_node *op2); */ ir_node *new_d_Conv (dbg_info *db, ir_node *op, ir_mode *mode); +/** Constructor for a strict Conv node. + * + * Adds the node to the block in current_ir_block. + * + * @param *db A pointer for debug information. + * @param *op The operand. + * @param *mode The mode of this the operand muss be converted . + */ +ir_node *new_d_strictConv (dbg_info *db, ir_node *op, ir_mode *mode); + /** Constructor for a Cast node. * * High level type cast @@ -3852,11 +3862,20 @@ ir_node *new_Cmp (ir_node *op1, ir_node *op2); * * Adds the node to the block in current_ir_block. * - * @param *op The operand. - * @param *mode The mode of this the operand muss be converted . + * @param *op The operand. + * @param *mode The mode of this the operand muss be converted. */ ir_node *new_Conv (ir_node *op, ir_mode *mode); +/** Constructor for a strict Conv node. + * + * Adds the node to the block in current_ir_block. + * + * @param *op The operand. + * @param *mode The mode of this the operand muss be converted. + */ +ir_node *new_strictConv (ir_node *op, ir_mode *mode); + /** Constructor for a Cast node. * * Adds the node to the block in current_ir_block. diff --git a/ir/ir/irdump.c b/ir/ir/irdump.c index ccb1d324b..c8462cf3b 100644 --- a/ir/ir/irdump.c +++ b/ir/ir/irdump.c @@ -733,6 +733,11 @@ int dump_node_opcode(FILE *F, ir_node *n) case iro_Block: fprintf (F, "%s%s", is_Block_dead(n) ? "Dead " : "", get_irn_opname(n)); break; + case iro_Conv: + if (get_Conv_strict(n)) + fprintf (F, "strict"); + fprintf (F, "%s", get_irn_opname(n)); + break; default: default_case: diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index 7b29f2063..e5dcddf5d 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -487,21 +487,21 @@ alloc_attr get_irn_alloc_attr (ir_node *node) { assert (node->op == op_Alloc); - return node->attr.a; + return node->attr.alloc; } free_attr get_irn_free_attr (ir_node *node) { assert (node->op == op_Free); - return node->attr.f; + return node->attr.free; } symconst_attr get_irn_symconst_attr (ir_node *node) { assert (node->op == op_SymConst); - return node->attr.i; + return node->attr.symc; } ir_type * @@ -515,7 +515,7 @@ sel_attr get_irn_sel_attr (ir_node *node) { assert (node->op == op_Sel); - return node->attr.s; + return node->attr.sel; } int @@ -892,19 +892,19 @@ set_Cond_selector (ir_node *node, ir_node *selector) { cond_kind get_Cond_kind (ir_node *node) { assert (node->op == op_Cond); - return node->attr.c.kind; + return node->attr.cond.kind; } void set_Cond_kind (ir_node *node, cond_kind kind) { assert (node->op == op_Cond); - node->attr.c.kind = kind; + node->attr.cond.kind = kind; } long get_Cond_defaultProj (ir_node *node) { assert (node->op == op_Cond); - return node->attr.c.default_proj; + return node->attr.cond.default_proj; } ir_node * @@ -994,41 +994,41 @@ set_Const_type (ir_node *node, ir_type *tp) { symconst_kind get_SymConst_kind (const ir_node *node) { assert (node->op == op_SymConst); - return node->attr.i.num; + return node->attr.symc.num; } void set_SymConst_kind (ir_node *node, symconst_kind num) { assert (node->op == op_SymConst); - node->attr.i.num = num; + node->attr.symc.num = num; } ir_type * get_SymConst_type (ir_node *node) { assert( (node->op == op_SymConst) && (SYMCONST_HAS_TYPE(get_SymConst_kind(node)))); - return node->attr.i.sym.type_p = skip_tid(node->attr.i.sym.type_p); + return node->attr.symc.sym.type_p = skip_tid(node->attr.symc.sym.type_p); } void set_SymConst_type (ir_node *node, ir_type *tp) { assert( (node->op == op_SymConst) && (SYMCONST_HAS_TYPE(get_SymConst_kind(node)))); - node->attr.i.sym.type_p = tp; + node->attr.symc.sym.type_p = tp; } ident * get_SymConst_name (ir_node *node) { assert ( (node->op == op_SymConst) && (get_SymConst_kind(node) == symconst_addr_name)); - return node->attr.i.sym.ident_p; + return node->attr.symc.sym.ident_p; } void set_SymConst_name (ir_node *node, ident *name) { assert ( (node->op == op_SymConst) && (get_SymConst_kind(node) == symconst_addr_name)); - node->attr.i.sym.ident_p = name; + node->attr.symc.sym.ident_p = name; } @@ -1036,39 +1036,38 @@ set_SymConst_name (ir_node *node, ident *name) { entity *get_SymConst_entity (ir_node *node) { assert ( (node->op == op_SymConst) && (get_SymConst_kind (node) == symconst_addr_ent)); - return node->attr.i.sym.entity_p; + return node->attr.symc.sym.entity_p; } void set_SymConst_entity (ir_node *node, entity *ent) { assert ( (node->op == op_SymConst) && (get_SymConst_kind(node) == symconst_addr_ent)); - node->attr.i.sym.entity_p = ent; + node->attr.symc.sym.entity_p = ent; } union symconst_symbol get_SymConst_symbol (ir_node *node) { assert (node->op == op_SymConst); - return node->attr.i.sym; + return node->attr.symc.sym; } void set_SymConst_symbol (ir_node *node, union symconst_symbol sym) { assert (node->op == op_SymConst); - //memcpy (&(node->attr.i.sym), sym, sizeof(type_or_id)); - node->attr.i.sym = sym; + node->attr.symc.sym = sym; } ir_type * get_SymConst_value_type (ir_node *node) { assert (node->op == op_SymConst); - if (node->attr.i.tp) node->attr.i.tp = skip_tid(node->attr.i.tp); - return node->attr.i.tp; + if (node->attr.symc.tp) node->attr.symc.tp = skip_tid(node->attr.symc.tp); + return node->attr.symc.tp; } void set_SymConst_value_type (ir_node *node, ir_type *tp) { assert (node->op == op_SymConst); - node->attr.i.tp = tp; + node->attr.symc.tp = tp; } ir_node * @@ -1126,13 +1125,13 @@ set_Sel_index (ir_node *node, int pos, ir_node *index) { entity * get_Sel_entity (ir_node *node) { assert (node->op == op_Sel); - return node->attr.s.ent; + return node->attr.sel.ent; } void set_Sel_entity (ir_node *node, entity *ent) { assert (node->op == op_Sel); - node->attr.s.ent = ent; + node->attr.sel.ent = ent; } @@ -1342,13 +1341,13 @@ BINOP(Mod) ir_node * get_Mod_mem (ir_node *node) { - assert (node->op == op_Mod); + assert(node->op == op_Mod); return get_irn_n(node, 0); } void set_Mod_mem (ir_node *node, ir_node *mem) { - assert (node->op == op_Mod); + assert(node->op == op_Mod); set_irn_n(node, 0, mem); } @@ -1365,15 +1364,25 @@ BINOP(Cmp) UNOP(Conv) UNOP(Cast) +int get_Conv_strict(ir_node *node) { + assert(node->op == op_Conv); + return node->attr.conv.strict; +} + +void set_Conv_strict(ir_node *node, int strict_flag) { + assert(node->op == op_Conv); + node->attr.conv.strict = (char)strict_flag; +} + ir_type * get_Cast_type (ir_node *node) { - assert (node->op == op_Cast); + assert(node->op == op_Cast); return node->attr.cast.totype; } void set_Cast_type (ir_node *node, ir_type *to_tp) { - assert (node->op == op_Cast); + assert(node->op == op_Cast); node->attr.cast.totype = to_tp; } @@ -1687,25 +1696,25 @@ set_Alloc_size (ir_node *node, ir_node *size) { ir_type * get_Alloc_type (ir_node *node) { assert (node->op == op_Alloc); - return node->attr.a.type = skip_tid(node->attr.a.type); + return node->attr.alloc.type = skip_tid(node->attr.alloc.type); } void set_Alloc_type (ir_node *node, ir_type *tp) { assert (node->op == op_Alloc); - node->attr.a.type = tp; + node->attr.alloc.type = tp; } where_alloc get_Alloc_where (ir_node *node) { assert (node->op == op_Alloc); - return node->attr.a.where; + return node->attr.alloc.where; } void set_Alloc_where (ir_node *node, where_alloc where) { assert (node->op == op_Alloc); - node->attr.a.where = where; + node->attr.alloc.where = where; } @@ -1748,25 +1757,25 @@ set_Free_size (ir_node *node, ir_node *size) { ir_type * get_Free_type (ir_node *node) { assert (node->op == op_Free); - return node->attr.f.type = skip_tid(node->attr.f.type); + return node->attr.free.type = skip_tid(node->attr.free.type); } void set_Free_type (ir_node *node, ir_type *tp) { assert (node->op == op_Free); - node->attr.f.type = tp; + node->attr.free.type = tp; } where_alloc get_Free_where (ir_node *node) { assert (node->op == op_Free); - return node->attr.f.where; + return node->attr.free.where; } void set_Free_where (ir_node *node, where_alloc where) { assert (node->op == op_Free); - node->attr.f.where = where; + node->attr.free.where = where; } ir_node **get_Sync_preds_arr (ir_node *node) { @@ -2137,13 +2146,13 @@ void set_CopyB_type(ir_node *node, ir_type *data_type) { ir_type * get_InstOf_type (ir_node *node) { assert (node->op = op_InstOf); - return node->attr.io.type; + return node->attr.instof.type; } void set_InstOf_type (ir_node *node, ir_type *type) { assert (node->op = op_InstOf); - node->attr.io.type = type; + node->attr.instof.type = type; } ir_node * diff --git a/ir/ir/irnode.h b/ir/ir/irnode.h index fd1b3d675..a2a881052 100644 --- a/ir/ir/irnode.h +++ b/ir/ir/irnode.h @@ -3,7 +3,7 @@ * File name: ir/ir/irnode.h * Purpose: Representation of an intermediate operation. * Author: Martin Trapp, Christian Schaefer - * Modified by: Goetz Lindenmaier + * Modified by: Goetz Lindenmaier, Michael Beck * Created: * CVS-ID: $Id$ * Copyright: (c) 1998-2003 Universität Karlsruhe @@ -767,6 +767,8 @@ void set_Rot_right (ir_node *node, ir_node *right); ir_node *get_Conv_op (ir_node *node); void set_Conv_op (ir_node *node, ir_node *op); +int get_Conv_strict (ir_node *node); +void set_Conv_strict (ir_node *node, int flag); /* Does Cast need a mem operator? * Cast should only depend on the type, not on the state of an diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index 9730a58ee..bfa4710c4 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -71,37 +71,32 @@ typedef struct { } block_attr; -/** Start attributes */ -typedef struct { - char dummy; - /* ir_graph *irg; @@@ now in block */ -} start_attr; - -/** Cond attributes */ +/** Cond attributes. */ typedef struct { cond_kind kind; /**< flavor of Cond */ long default_proj; /**< only for non-binary Conds: biggest Proj number, i.e. the one used for default. */ cond_jmp_predicate pred; /**< only for binary Conds: The jump predication. */ } cond_attr; -/** Const attributes */ +/** Const attributes. */ typedef struct { tarval *tv; /**< the target value */ ir_type *tp; /**< the source type, for analyses. default: type_unknown. */ } const_attr; +/** SymConst attributes. */ typedef struct { symconst_symbol sym; // old tori symconst_kind num; ir_type *tp; /**< the source type, for analyses. default: type_unknown. */ } symconst_attr; -/** Sel attributes */ +/** Sel attributes. */ typedef struct { entity *ent; /**< entity to select */ } sel_attr; -/** Exception attributes */ +/** Exception attributes. */ typedef struct { op_pin_state pin_state; /**< the pin state for operations that might generate a exception: If it's know that no exception will be generated, could be set to @@ -111,33 +106,33 @@ typedef struct { #endif } except_attr; -/** Call attributes */ +/** Call attributes. */ typedef struct { except_attr exc; /**< the exception attribute. MUST be the first one. */ ir_type *cld_tp; /**< type of called procedure */ entity ** callee_arr; /**< result of callee analysis */ } call_attr; -/** Alloc attributes */ +/** Alloc attributes. */ typedef struct { except_attr exc; /**< the exception attribute. MUST be the first one. */ ir_type *type; /**< Type of the allocated object. */ where_alloc where; /**< stack, heap or other managed part of memory */ } alloc_attr; -/** Free attributes */ +/** Free attributes. */ typedef struct { ir_type *type; /**< Type of the allocated object. */ where_alloc where; /**< stack, heap or other managed part of memory */ } free_attr; -/** InstOf attributes */ +/** InstOf attributes. */ typedef struct { except_attr exc; /**< the exception attribute. MUST be the first one. */ ir_type *type; /**< the type of which the object pointer must be */ } io_attr; -/** Filter attributes */ +/** Filter attributes. */ typedef struct { long proj; /**< contains the result position to project (Proj) */ ir_node ** in_cg; /**< array with interprocedural predecessors (Phi) */ @@ -145,29 +140,29 @@ typedef struct { @todo Ev. replace by bitfield! */ } filter_attr; -/** EndReg/EndExcept attributes */ +/** EndReg/EndExcept attributes. */ typedef struct { char dummy; } end_attr; -/** CallBegin attributes */ +/** CallBegin attributes. */ typedef struct { ir_node * call; /**< Associated Call-operation. */ } callbegin_attr; -/** Cast attributes */ +/** Cast attributes. */ typedef struct { ir_type *totype; /**< Type of the casted node. */ } cast_attr; -/** Load attributes */ +/** Load attributes. */ typedef struct { except_attr exc; /**< The exception attribute. MUST be the first one. */ ir_mode *load_mode; /**< The mode of this Load operation. */ ent_volatility volatility; /**< The volatility of a Load/Store operation. */ } load_attr; -/** Store attributes */ +/** Store attributes. */ typedef struct { except_attr exc; /**< the exception attribute. MUST be the first one. */ ent_volatility volatility; /**< the volatility of a Store operation */ @@ -175,17 +170,22 @@ typedef struct { typedef pn_Cmp confirm_attr; /**< Attribute to hold compare operation */ -/** CopyB attribute */ +/** CopyB attribute. */ typedef struct { except_attr exc; /**< The exception attribute. MUST be the first one. */ ir_type *data_type; /**< Type of the copied entity. */ } copyb_attr; -/** Bound attribute */ +/** Bound attribute. */ typedef struct { except_attr exc; /**< The exception attribute. MUST be the first one. */ } bound_attr; +/** Conv attribute. */ +typedef struct { + char strict; /**< If set, this is a strict Conv that cannot be removed. */ +} conv_attr; + /** * Edge info to put into an irn. */ @@ -198,19 +198,18 @@ typedef struct _irn_edge_info_t { /** Some IR-nodes just have one attribute, these are stored here, some have more. Their name is 'irnodename_attr' */ typedef union { - start_attr start; /**< For Start */ - block_attr block; /**< For Block: Fields needed to construct it */ - cond_attr c; /**< For Cond. */ - const_attr con; /**< For Const: contains the value of the constant and a type */ - symconst_attr i; /**< For SymConst. */ - sel_attr s; /**< For Sel. */ - call_attr call; /**< For Call: pointer to the type of the method to call */ + block_attr block; /**< For Block: Fields needed to construct it */ + cond_attr cond; /**< For Cond. */ + const_attr con; /**< For Const: contains the value of the constant and a type */ + symconst_attr symc; /**< For SymConst. */ + sel_attr sel; /**< For Sel. */ + call_attr call; /**< For Call: pointer to the type of the method to call */ callbegin_attr callbegin; /**< For CallBegin */ - alloc_attr a; /**< For Alloc. */ - free_attr f; /**< For Free. */ - io_attr io; /**< For InstOf */ - cast_attr cast; /**< For Cast. */ - load_attr load; /**< For Load. */ + alloc_attr alloc; /**< For Alloc. */ + free_attr free; /**< For Free. */ + io_attr instof; /**< For InstOf */ + cast_attr cast; /**< For Cast. */ + load_attr load; /**< For Load. */ store_attr store; /**< For Store. */ int phi0_pos; /**< For Phi. Used to remember the value defined by this Phi node. Needed when the Phi is completed @@ -228,6 +227,7 @@ typedef union { except_attr except; /**< For Phi node construction in case of exceptions */ copyb_attr copyb; /**< For CopyB operation */ bound_attr bound; /**< For Bound operation */ + conv_attr conv; /**< For Conv operation */ } attr; @@ -800,12 +800,12 @@ static INLINE int _is_irn_machine_user(const ir_node *node, unsigned n) { static INLINE cond_jmp_predicate _get_Cond_jmp_pred(ir_node *node) { assert (_get_irn_op(node) == op_Cond); - return node->attr.c.pred; + return node->attr.cond.pred; } static INLINE void _set_Cond_jmp_pred(ir_node *node, cond_jmp_predicate pred) { assert (_get_irn_op(node) == op_Cond); - node->attr.c.pred = pred; + node->attr.cond.pred = pred; } static INLINE int _get_Psi_n_conds(ir_node *node) { diff --git a/ir/ir/irop.c b/ir/ir/irop.c index 7241d5ee9..f4431ba83 100644 --- a/ir/ir/irop.c +++ b/ir/ir/irop.c @@ -215,7 +215,7 @@ init_op(void) op_Block = new_ir_op(iro_Block, "Block", op_pin_state_pinned, L, oparity_variable, -1, sizeof(block_attr), NULL); - op_Start = new_ir_op(iro_Start, "Start", op_pin_state_pinned, X, oparity_zero, -1, sizeof(start_attr), NULL); + op_Start = new_ir_op(iro_Start, "Start", op_pin_state_pinned, X, oparity_zero, -1, 0, NULL); op_End = new_ir_op(iro_End, "End", op_pin_state_pinned, X, oparity_dynamic, -1, 0, NULL); op_Jmp = new_ir_op(iro_Jmp, "Jmp", op_pin_state_pinned, X, oparity_zero, -1, 0, NULL); op_IJmp = new_ir_op(iro_IJmp, "IJmp", op_pin_state_pinned, X|K, oparity_unary, -1, 0, NULL); @@ -246,7 +246,7 @@ init_op(void) op_Shr = new_ir_op(iro_Shr, "Shr", op_pin_state_floats, N, oparity_binary, 0, 0, NULL); op_Shrs = new_ir_op(iro_Shrs, "Shrs", op_pin_state_floats, N, oparity_binary, 0, 0, NULL); op_Rot = new_ir_op(iro_Rot, "Rot", op_pin_state_floats, N, oparity_binary, 0, 0, NULL); - op_Conv = new_ir_op(iro_Conv, "Conv", op_pin_state_floats, N, oparity_unary, 0, 0, NULL); + op_Conv = new_ir_op(iro_Conv, "Conv", op_pin_state_floats, N, oparity_unary, 0, sizeof(conv_attr), NULL); op_Cast = new_ir_op(iro_Cast, "Cast", op_pin_state_floats, N|H, oparity_unary, 0, sizeof(cast_attr), NULL); op_Carry = new_ir_op(iro_Carry, "Carry", op_pin_state_floats, C, oparity_binary, 0, 0, NULL); op_Borrow = new_ir_op(iro_Borrow, "Borrow", op_pin_state_floats, N, oparity_binary, 0, 0, NULL); -- 2.20.1