1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-pre-stats" } */
3 typedef union tree_node
*tree
;
8 VEC_constructor_elt_base
;
15 struct tree_common common
;
16 struct tree_ssa_name ssa_name
;
20 struct basic_block_def
*dest
;
22 typedef struct edge_def
*edge
;
23 typedef struct VEC_edge_base
28 VEC_edge_base_index (const VEC_edge_base
* vec_
, unsigned ix_
)
31 typedef struct VEC_edge_gc
36 struct basic_block_def
40 typedef struct basic_block_def
*basic_block
;
44 VEC_edge_gc
**container
;
47 __inline__ VEC_edge_gc
*
48 ei_container (edge_iterator i
)
52 __inline__ edge_iterator
53 ei_start_1 (VEC_edge_gc
** ev
)
59 ei_next (edge_iterator
* i
)
62 static __inline__ edge
63 ei_edge (edge_iterator i
)
65 return (edge
) (VEC_edge_base_index ((((ei_container (i
))) ? &((ei_container (i
)))->base
: 0), (i
.index
)));
67 static __inline__
unsigned char
68 ei_cond (edge_iterator ei
, edge
* p
)
72 typedef tree
*def_operand_p
;
73 extern tree
*get_phi_result_ptr (tree
);
74 static __inline__ tree
75 get_def_from_ptr (def_operand_p def
)
79 phi_nodes (basic_block bb
)
83 /* We can eliminate a load of the SRA'd variable edge_iterator.container */
84 rewrite_add_phi_arguments (basic_block bb
)
88 for ((ei
) = ei_start_1 (&((bb
->succs
))); ei_cond ((ei
), &(e
));
92 for (phi
= phi_nodes (e
->dest
); phi
; phi
= (((phi
))->common
.chain
))
93 get_reaching_def ((get_def_from_ptr (get_phi_result_ptr (phi
)))->ssa_name
.var
);
96 /* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
97 /* { dg-final { cleanup-tree-dump "pre" } } */