/* Interface to SSA operands. */
+
+/* This represents a pointer to a DEF operand. */
+typedef struct def_operand_ptr GTY(())
+{
+ tree * GTY((skip(""))) def;
+} def_operand_p;
+
+/* This represents a pointer to a USE operand. */
+typedef struct use_operand_ptr GTY(())
+{
+ tree * GTY((skip(""))) use;
+} use_operand_p;
+
+
+/* This represents the DEF operands of a stmt. */
typedef struct def_optype_d GTY(())
{
unsigned num_defs;
- tree * GTY((length("%h.num_defs"), skip(""))) defs[1];
+ struct def_operand_ptr GTY((length("%h.num_defs"))) defs[1];
} def_optype_t;
typedef def_optype_t *def_optype;
+/* This represents the USE operands of a stmt. */
typedef struct use_optype_d GTY(())
{
unsigned num_uses;
- tree * GTY((length("%h.num_uses"), skip(""))) uses[1];
+ struct use_operand_ptr GTY((length("%h.num_uses"))) uses[1];
} use_optype_t;
typedef use_optype_t *use_optype;
-typedef struct vdef_optype_d GTY(())
+/* Operand type which stores a def and a use tree. */
+typedef struct v_may_def_operand_type GTY(())
{
- unsigned num_vdefs;
- tree GTY((length ("%h.num_vdefs * 2"))) vdefs[1];
-} vdef_optype_t;
+ tree def;
+ tree use;
+} v_may_def_operand_type_t;
-typedef vdef_optype_t *vdef_optype;
+/* This represents the MAY_DEFS for a stmt. */
+typedef struct v_may_def_optype_d GTY(())
+{
+ unsigned num_v_may_defs;
+ struct v_may_def_operand_type GTY((length ("%h.num_v_may_defs")))
+ v_may_defs[1];
+} v_may_def_optype_t;
+
+typedef v_may_def_optype_t *v_may_def_optype;
+/* This represents the VUSEs for a stmt. */
typedef struct vuse_optype_d GTY(())
{
unsigned num_vuses;
typedef vuse_optype_t *vuse_optype;
+/* This represents the V_MUST_DEFS for a stmt. */
+typedef struct v_must_def_optype_d GTY(())
+{
+ unsigned num_v_must_defs;
+ tree GTY((length("%h.num_v_must_defs"))) v_must_defs[1];
+} v_must_def_optype_t;
+
+typedef v_must_def_optype_t *v_must_def_optype;
+
+/* This represents the operand cache fora stmt. */
+typedef struct stmt_operands_d GTY(())
+{
+ /* Statement operands. */
+ struct def_optype_d * GTY (()) def_ops;
+ struct use_optype_d * GTY (()) use_ops;
+
+ /* Virtual operands (V_MAY_DEF, VUSE, and V_MUST_DEF). */
+ struct v_may_def_optype_d * GTY (()) v_may_def_ops;
+ struct vuse_optype_d * GTY (()) vuse_ops;
+ struct v_must_def_optype_d * GTY (()) v_must_def_ops;
+} stmt_operands_t;
+
+typedef stmt_operands_t *stmt_operands_p;
+
+#define USE_FROM_PTR(OP) get_use_from_ptr (OP)
+#define DEF_FROM_PTR(OP) get_def_from_ptr (OP)
+#define SET_USE(OP, V) ((*((OP).use)) = (V))
+#define SET_DEF(OP, V) ((*((OP).def)) = (V))
+
+
#define USE_OPS(ANN) get_use_ops (ANN)
#define STMT_USE_OPS(STMT) get_use_ops (stmt_ann (STMT))
#define NUM_USES(OPS) ((OPS) ? (OPS)->num_uses : 0)
#define USE_OP_PTR(OPS, I) get_use_op_ptr ((OPS), (I))
-#define USE_OP(OPS, I) (*(USE_OP_PTR ((OPS), (I))))
+#define USE_OP(OPS, I) (USE_FROM_PTR (USE_OP_PTR ((OPS), (I))))
+#define SET_USE_OP(OPS, I, V) (SET_USE (USE_OP_PTR ((OPS), (I)), (V)))
+
#define DEF_OPS(ANN) get_def_ops (ANN)
#define STMT_DEF_OPS(STMT) get_def_ops (stmt_ann (STMT))
#define NUM_DEFS(OPS) ((OPS) ? (OPS)->num_defs : 0)
#define DEF_OP_PTR(OPS, I) get_def_op_ptr ((OPS), (I))
-#define DEF_OP(OPS, I) (*(DEF_OP_PTR ((OPS), (I))))
+#define DEF_OP(OPS, I) (DEF_FROM_PTR (DEF_OP_PTR ((OPS), (I))))
+#define SET_DEF_OP(OPS, I, V) (SET_DEF (DEF_OP_PTR ((OPS), (I)), (V)))
-#define VDEF_OPS(ANN) get_vdef_ops (ANN)
-#define STMT_VDEF_OPS(STMT) get_vdef_ops (stmt_ann(STMT))
-#define NUM_VDEFS(OPS) ((OPS) ? (OPS)->num_vdefs : 0)
-#define VDEF_RESULT_PTR(OPS, I) get_vdef_result_ptr ((OPS), (I))
-#define VDEF_RESULT(OPS, I) (*(VDEF_RESULT_PTR ((OPS), (I))))
-#define VDEF_OP_PTR(OPS, I) get_vdef_op_ptr ((OPS), (I))
-#define VDEF_OP(OPS, I) (*(VDEF_OP_PTR ((OPS), (I))))
+
+#define V_MAY_DEF_OPS(ANN) get_v_may_def_ops (ANN)
+#define STMT_V_MAY_DEF_OPS(STMT) get_v_may_def_ops (stmt_ann(STMT))
+#define NUM_V_MAY_DEFS(OPS) ((OPS) ? (OPS)->num_v_may_defs : 0)
+#define V_MAY_DEF_RESULT_PTR(OPS, I) get_v_may_def_result_ptr ((OPS), (I))
+#define V_MAY_DEF_RESULT(OPS, I) \
+ (DEF_FROM_PTR (V_MAY_DEF_RESULT_PTR ((OPS), (I))))
+#define SET_V_MAY_DEF_RESULT(OPS, I, V) \
+ (SET_DEF (V_MAY_DEF_RESULT_PTR ((OPS), (I)), (V)))
+#define V_MAY_DEF_OP_PTR(OPS, I) get_v_may_def_op_ptr ((OPS), (I))
+#define V_MAY_DEF_OP(OPS, I) \
+ (USE_FROM_PTR (V_MAY_DEF_OP_PTR ((OPS), (I))))
+#define SET_V_MAY_DEF_OP(OPS, I, V) \
+ (SET_USE (V_MAY_DEF_OP_PTR ((OPS), (I)), (V)))
#define VUSE_OPS(ANN) get_vuse_ops (ANN)
#define STMT_VUSE_OPS(STMT) get_vuse_ops (stmt_ann(STMT))
#define NUM_VUSES(OPS) ((OPS) ? (OPS)->num_vuses : 0)
#define VUSE_OP_PTR(OPS, I) get_vuse_op_ptr ((OPS), (I))
-#define VUSE_OP(OPS, I) (*(VUSE_OP_PTR ((OPS), (I))))
+#define VUSE_OP(OPS, I) (USE_FROM_PTR (VUSE_OP_PTR ((OPS), (I))))
+#define SET_VUSE_OP(OPS, I, V) (SET_USE (VUSE_OP_PTR ((OPS), (I)), (V)))
+
+
+#define V_MUST_DEF_OPS(ANN) get_v_must_def_ops (ANN)
+#define STMT_V_MUST_DEF_OPS(STMT) get_v_must_def_ops (stmt_ann (STMT))
+#define NUM_V_MUST_DEFS(OPS) ((OPS) ? (OPS)->num_v_must_defs : 0)
+#define V_MUST_DEF_OP_PTR(OPS, I) get_v_must_def_op_ptr ((OPS), (I))
+#define V_MUST_DEF_OP(OPS, I) \
+ (DEF_FROM_PTR (V_MUST_DEF_OP_PTR ((OPS), (I))))
+#define SET_V_MUST_DEF_OP(OPS, I, V) \
+ (SET_DEF (V_MUST_DEF_OP_PTR ((OPS), (I)), (V)))
+
+
+#define PHI_RESULT_PTR(PHI) get_phi_result_ptr (PHI)
+#define PHI_RESULT(PHI) DEF_FROM_PTR (PHI_RESULT_PTR (PHI))
+#define SET_PHI_RESULT(PHI, V) SET_DEF (PHI_RESULT_PTR (PHI), (V))
+
+#define PHI_ARG_DEF_PTR(PHI, I) get_phi_arg_def_ptr ((PHI), (I))
+#define PHI_ARG_DEF(PHI, I) USE_FROM_PTR (PHI_ARG_DEF_PTR ((PHI), (I)))
+#define SET_PHI_ARG_DEF(PHI, I, V) \
+ SET_USE (PHI_ARG_DEF_PTR ((PHI), (I)), (V))
+#define PHI_ARG_DEF_FROM_EDGE(PHI, E) \
+ PHI_ARG_DEF ((PHI), \
+ phi_arg_from_edge ((PHI),(E)))
+#define PHI_ARG_DEF_PTR_FROM_EDGE(PHI, E) \
+ PHI_ARG_DEF_PTR ((PHI), \
+ phi_arg_from_edge ((PHI),(E)))
extern void init_ssa_operands (void);
extern void fini_ssa_operands (void);
-extern void verify_start_operands (tree);
-extern void finalize_ssa_stmt_operands (tree);
-void add_vuse (tree, tree);
extern void get_stmt_operands (tree);
-extern void remove_vuses (tree);
-extern void remove_vdefs (tree);
+extern void copy_virtual_operands (tree, tree);
+extern void create_ssa_artficial_load_stmt (stmt_operands_p, tree);
#endif /* GCC_TREE_SSA_OPERANDS_H */