summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/loadpre8.c
blob: 86cb1e46bba7f7a4556662b7ce8f8538e72d372e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* { dg-do compile } */ 
/* { dg-options "-O2 -fdump-tree-pre-stats" } */
typedef union tree_node *tree;
struct tree_common
{
  tree chain;
}
VEC_constructor_elt_base;
struct tree_ssa_name
{
  tree var;
};
union tree_node
{
  struct tree_common common;
  struct tree_ssa_name ssa_name;
};
struct edge_def
{
  struct basic_block_def *dest;
};
typedef struct edge_def *edge;
typedef struct VEC_edge_base
{
}
VEC_edge_base;
edge
VEC_edge_base_index (const VEC_edge_base * vec_, unsigned ix_)
{
}
typedef struct VEC_edge_gc
{
  VEC_edge_base base;
}
VEC_edge_gc;
struct basic_block_def
{
  VEC_edge_gc *succs;
};
typedef struct basic_block_def *basic_block;
typedef struct
{
  unsigned index;
  VEC_edge_gc **container;
}
edge_iterator;
__inline__ VEC_edge_gc *
ei_container (edge_iterator i)
{
  return *i.container;
}
__inline__ edge_iterator
ei_start_1 (VEC_edge_gc ** ev)
{
  edge_iterator i;
  i.container = ev;
  return i;
}
ei_next (edge_iterator * i)
{
}
static __inline__ edge
ei_edge (edge_iterator i)
{
  return  (edge) (VEC_edge_base_index ((((ei_container (i))) ? &((ei_container (i)))->base : 0), (i.index)));
}
static __inline__ unsigned char
ei_cond (edge_iterator ei, edge * p)
{
  *p = ei_edge (ei);
}
typedef tree *def_operand_p;
extern tree *get_phi_result_ptr (tree);
static __inline__ tree
get_def_from_ptr (def_operand_p def)
{
}
tree
phi_nodes (basic_block bb)
{
}

/* We can eliminate a load of the SRA'd variable edge_iterator.container */
rewrite_add_phi_arguments (basic_block bb)
{
  edge e;
  edge_iterator ei;
  for ((ei) = ei_start_1 (&((bb->succs))); ei_cond ((ei), &(e));
       ei_next (&(ei)))
    {
      tree phi;
      for (phi = phi_nodes (e->dest); phi; phi = (((phi))->common.chain))
	  get_reaching_def ((get_def_from_ptr (get_phi_result_ptr (phi)))->ssa_name.var);
    }
}
/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */