]>
Commit | Line | Data |
---|---|---|
eab5c70a | 1 | /* Common subexpression elimination for GNU compiler. |
2398fb2a | 2 | Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, |
d9221e01 | 3 | 1999, 2003, 2004 Free Software Foundation, Inc. |
eab5c70a | 4 | |
1322177d | 5 | This file is part of GCC. |
eab5c70a | 6 | |
1322177d LB |
7 | GCC is free software; you can redistribute it and/or modify it under |
8 | the terms of the GNU General Public License as published by the Free | |
9 | Software Foundation; either version 2, or (at your option) any later | |
10 | version. | |
eab5c70a | 11 | |
1322177d LB |
12 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | for more details. | |
eab5c70a BS |
16 | |
17 | You should have received a copy of the GNU General Public License | |
1322177d LB |
18 | along with GCC; see the file COPYING. If not, write to the Free |
19 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA | |
20 | 02111-1307, USA. */ | |
eab5c70a BS |
21 | |
22 | /* Describe a value. */ | |
e2500fed | 23 | typedef struct cselib_val_struct GTY(()) |
eab5c70a BS |
24 | { |
25 | /* The hash value. */ | |
26 | unsigned int value; | |
e2500fed | 27 | union cselib_val_u |
eab5c70a BS |
28 | { |
29 | /* A VALUE rtx that points back to this structure. */ | |
e2500fed | 30 | rtx GTY ((tag ("1"))) val_rtx; |
eab5c70a | 31 | /* Used to keep a list of free cselib_val structures. */ |
1431042e | 32 | struct cselib_val_struct * GTY ((skip)) next_free; |
e2500fed | 33 | } GTY ((desc ("1"))) u; |
eab5c70a BS |
34 | |
35 | /* All rtl expressions that hold this value at the current time during a | |
36 | scan. */ | |
37 | struct elt_loc_list *locs; | |
38 | /* If this value is used as an address, points to a list of values that | |
39 | use it as an address in a MEM. */ | |
40 | struct elt_list *addr_list; | |
7101fb18 JH |
41 | |
42 | struct cselib_val_struct *next_containing_mem; | |
eab5c70a BS |
43 | } cselib_val; |
44 | ||
45 | /* A list of rtl expressions that hold the same value. */ | |
e2500fed | 46 | struct elt_loc_list GTY(()) |
eab5c70a BS |
47 | { |
48 | /* Next element in the list. */ | |
49 | struct elt_loc_list *next; | |
50 | /* An rtl expression that holds the value. */ | |
51 | rtx loc; | |
52 | /* The insn that made the equivalence. */ | |
53 | rtx setting_insn; | |
9635cfad JH |
54 | /* True when setting insn is inside libcall. */ |
55 | bool in_libcall; | |
eab5c70a BS |
56 | }; |
57 | ||
58 | /* A list of cselib_val structures. */ | |
e2500fed | 59 | struct elt_list GTY(()) |
eab5c70a BS |
60 | { |
61 | struct elt_list *next; | |
62 | cselib_val *elt; | |
63 | }; | |
64 | ||
7080f735 | 65 | extern cselib_val *cselib_lookup (rtx, enum machine_mode, int); |
463301c3 | 66 | extern void cselib_init (bool record_memory); |
7080f735 AJ |
67 | extern void cselib_finish (void); |
68 | extern void cselib_process_insn (rtx); | |
69 | extern enum machine_mode cselib_reg_set_mode (rtx); | |
70 | extern int rtx_equal_for_cselib_p (rtx, rtx); | |
71 | extern int references_value_p (rtx, int); | |
72 | extern rtx cselib_subst_to_values (rtx); |