Initial revision
[gcc.git] / gcc / reload.h
1 /* Communication between reload.c and reload1.c.
2 Copyright (C) 1987, 1991 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20
21 /* See reload.c and reload1.c for comments on these variables. */
22
23 /* Maximum number of reloads we can need. */
24 #define MAX_RELOADS (2 * MAX_RECOG_OPERANDS * (MAX_REGS_PER_ADDRESS + 1))
25
26 extern rtx reload_in[MAX_RELOADS];
27 extern rtx reload_out[MAX_RELOADS];
28 extern rtx reload_in_reg[MAX_RELOADS];
29 extern enum reg_class reload_reg_class[MAX_RELOADS];
30 extern enum machine_mode reload_inmode[MAX_RELOADS];
31 extern enum machine_mode reload_outmode[MAX_RELOADS];
32 extern char reload_strict_low[MAX_RELOADS];
33 extern char reload_optional[MAX_RELOADS];
34 extern int reload_inc[MAX_RELOADS];
35 extern int reload_needed_for_multiple[MAX_RELOADS];
36 extern rtx reload_needed_for[MAX_RELOADS];
37 extern int reload_secondary_reload[MAX_RELOADS];
38 extern int reload_secondary_p[MAX_RELOADS];
39 extern int n_reloads;
40
41 extern rtx reload_reg_rtx[MAX_RELOADS];
42
43 enum reload_when_needed
44 {
45 RELOAD_FOR_INPUT_RELOAD_ADDRESS,
46 RELOAD_FOR_OUTPUT_RELOAD_ADDRESS,
47 RELOAD_FOR_OPERAND_ADDRESS,
48 /* The following two are not fully implemented.
49 They are used in emitting insns, but they aren't distinguished from
50 RELOAD_OTHER when computing the number of spills. What they accomplish
51 is to avoid precluding inheritance of already loaded values
52 for input reloads when there are also output reloads. */
53 RELOAD_FOR_INPUT,
54 RELOAD_FOR_OUTPUT,
55 RELOAD_OTHER
56 };
57
58 extern enum reload_when_needed reload_when_needed[MAX_RELOADS];
59
60 extern rtx *reg_equiv_constant;
61 extern rtx *reg_equiv_address;
62 extern rtx *reg_equiv_mem;
63
64 /* All the "earlyclobber" operands of the current insn
65 are recorded here. */
66 extern int n_earlyclobbers;
67 extern rtx reload_earlyclobbers[MAX_RECOG_OPERANDS];
68
69 /* First uid used by insns created by reload in this function.
70 Used in find_equiv_reg. */
71 extern int reload_first_uid;
72
73 /* Nonzero if indirect addressing is supported when the innermost MEM is
74 of the form (MEM (SYMBOL_REF sym)). It is assumed that the level to
75 which these are valid is the same as spill_indirect_levels, above. */
76
77 extern char indirect_symref_ok;
78
79 /* Nonzero if an address (plus (reg frame_pointer) (reg ...)) is valid. */
80 extern char double_reg_address_ok;
81
82 void init_reload ();
83 void find_reloads ();
84 void subst_reloads ();
85 rtx eliminate_regs ();