From ee49a847b829a2d2a204b7ae68e54df1ed8cd9d9 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 29 Sep 2006 18:57:27 +0000 Subject: [PATCH] irop_flag_start_block flag added [r8311] --- ir/ir/irop.c | 11 +++++++---- ir/ir/irop.h | 35 ++++++++++++++++++----------------- ir/ir/irop_t.h | 5 +++++ 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/ir/ir/irop.c b/ir/ir/irop.c index 6ca5e62b1..4a0ae5441 100644 --- a/ir/ir/irop.c +++ b/ir/ir/irop.c @@ -213,7 +213,9 @@ init_op(void) #define H irop_flag_highlevel #define c irop_flag_constlike #define K irop_flag_keep +#define S irop_flag_start_block + /* Caution: A great deal of Firm optimizations depend an right operations flags. */ 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, 0, NULL); @@ -223,8 +225,8 @@ init_op(void) op_Cond = new_ir_op(iro_Cond, "Cond", op_pin_state_pinned, X|Y, oparity_any, -1, sizeof(cond_attr), NULL); op_Return = new_ir_op(iro_Return, "Return", op_pin_state_pinned, X, oparity_zero, -1, 0, NULL); - op_Const = new_ir_op(iro_Const, "Const", op_pin_state_floats, c, oparity_zero, -1, sizeof(const_attr), NULL); - op_SymConst = new_ir_op(iro_SymConst, "SymConst", op_pin_state_floats, c, oparity_zero, -1, sizeof(symconst_attr), NULL); + op_Const = new_ir_op(iro_Const, "Const", op_pin_state_floats, c|S, oparity_zero, -1, sizeof(const_attr), NULL); + op_SymConst = new_ir_op(iro_SymConst, "SymConst", op_pin_state_floats, c|S, oparity_zero, -1, sizeof(symconst_attr), NULL); op_Sel = new_ir_op(iro_Sel, "Sel", op_pin_state_floats, H, oparity_any, -1, sizeof(sel_attr), NULL); @@ -263,10 +265,10 @@ init_op(void) op_Proj = new_ir_op(iro_Proj, "Proj", op_pin_state_floats, N, oparity_any, -1, sizeof(long), NULL); op_Tuple = new_ir_op(iro_Tuple, "Tuple", op_pin_state_floats, L, oparity_variable, -1, 0, NULL); op_Id = new_ir_op(iro_Id, "Id", op_pin_state_floats, N, oparity_any, -1, 0, NULL); - op_Bad = new_ir_op(iro_Bad, "Bad", op_pin_state_pinned, X|F, oparity_zero, -1, 0, NULL); + op_Bad = new_ir_op(iro_Bad, "Bad", op_pin_state_pinned, X|F|S, oparity_zero, -1, 0, NULL); op_Confirm = new_ir_op(iro_Confirm, "Confirm", op_pin_state_pinned, H, oparity_any, -1, sizeof(confirm_attr), NULL); - op_Unknown = new_ir_op(iro_Unknown, "Unknown", op_pin_state_pinned, X|F, oparity_zero, -1, 0, NULL); + op_Unknown = new_ir_op(iro_Unknown, "Unknown", op_pin_state_pinned, X|F|S, oparity_zero, -1, 0, NULL); op_Filter = new_ir_op(iro_Filter, "Filter", op_pin_state_pinned, N, oparity_variable, -1, sizeof(filter_attr), NULL); op_Break = new_ir_op(iro_Break, "Break", op_pin_state_pinned, X, oparity_zero, -1, 0, NULL); op_CallBegin = new_ir_op(iro_CallBegin, "CallBegin", op_pin_state_pinned, X|I, oparity_any, -1, sizeof(callbegin_attr), NULL); @@ -284,6 +286,7 @@ init_op(void) op_Pin = new_ir_op(iro_Pin, "Pin", op_pin_state_pinned, H, oparity_unary, -1, 0, NULL); +#undef S #undef H #undef Y #undef F diff --git a/ir/ir/irop.h b/ir/ir/irop.h index a8f4d766a..bd6cf7c1b 100644 --- a/ir/ir/irop.h +++ b/ir/ir/irop.h @@ -47,23 +47,24 @@ typedef enum { /** The irop flags */ typedef enum { - irop_flag_none = 0x00000000, /**< nothing */ - irop_flag_labeled = 0x00000001, /**< if set, Output edge labels on in-edges in vcg graph */ - irop_flag_commutative = 0x00000002, /**< operation is commutative */ - irop_flag_cfopcode = 0x00000004, /**< is a control flow operation */ - irop_flag_ip_cfopcode = 0x00000008, /**< operation manipulates interprocedural control flow */ - irop_flag_fragile = 0x00000010, /**< set if the operation can change the control flow because - of an exception */ - irop_flag_forking = 0x00000020, /**< the operation is a forking control flow */ - irop_flag_highlevel = 0x00000040, /**< the operation is a pure high-level one and can be - skipped in low-level optimizations */ - irop_flag_constlike = 0x00000080, /**< the operation has no arguments and is some - kind of a constant */ - irop_flag_always_opt = 0x00000100, /**< this operation must always be optimized */ - irop_flag_keep = 0x00000200, /**< this operation can be kept in End's keep-alive list */ - irop_flag_machine = 0x00000400, /**< this operation is a machine operation */ - irop_flag_machine_op = 0x00000800, /**< this operation is a machine operand */ - irop_flag_user = 0x00001000 /**< this flag and all higher one are free for machine user */ + irop_flag_none = 0x00000000, /**< Nothing. */ + irop_flag_labeled = 0x00000001, /**< If set, output edge labels on in-edges in vcg graph. */ + irop_flag_commutative = 0x00000002, /**< This operation is commutative. */ + irop_flag_cfopcode = 0x00000004, /**< This operation is a control flow operation. */ + irop_flag_ip_cfopcode = 0x00000008, /**< This operation manipulates the interprocedural control flow. */ + irop_flag_fragile = 0x00000010, /**< Set if the operation can change the control flow because + of an exception. */ + irop_flag_forking = 0x00000020, /**< Forking control flow at this operation. */ + irop_flag_highlevel = 0x00000040, /**< This operation is a pure high-level one and can be + skipped in low-level optimizations. */ + irop_flag_constlike = 0x00000080, /**< This operation has no arguments and is some + kind of a constant. */ + irop_flag_always_opt = 0x00000100, /**< This operation must always be optimized .*/ + irop_flag_keep = 0x00000200, /**< This operation can be kept in End's keep-alive list. */ + irop_flag_start_block = 0x00000400, /**< This operation is always placed in the Start block. */ + irop_flag_machine = 0x00000800, /**< This operation is a machine operation. */ + irop_flag_machine_op = 0x00001000, /**< This operation is a machine operand. */ + irop_flag_user = 0x00002000 /**< This flag and all higher ones are free for machine user. */ } irop_flags; /** The opcodes of the libFirm predefined operations. */ diff --git a/ir/ir/irop_t.h b/ir/ir/irop_t.h index ae1f0e036..6082e05fe 100644 --- a/ir/ir/irop_t.h +++ b/ir/ir/irop_t.h @@ -111,6 +111,11 @@ static INLINE int is_op_keep(const ir_op *op) { return op->flags & irop_flag_keep; } +/** Returns non-zero if operation must always be placed in the start block. */ +static INLINE int is_op_start_block_placed(const ir_op *op) { + return op->flags & irop_flag_start_block; +} + /** Returns non-zero if operation is a machine operation */ static INLINE int is_op_machine(const ir_op *op) { return op->flags & irop_flag_machine; -- 2.20.1