]>
Commit | Line | Data |
---|---|---|
1f234b83 | 1 | /* This file contains definitions for the register renamer. |
a5544970 | 2 | Copyright (C) 2011-2019 Free Software Foundation, Inc. |
1f234b83 BS |
3 | |
4 | This file is part of GCC. | |
5 | ||
6 | GCC is free software; you can redistribute it and/or modify it under | |
7 | the terms of the GNU General Public License as published by the Free | |
8 | Software Foundation; either version 3, or (at your option) any later | |
9 | version. | |
10 | ||
11 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
12 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GCC; see the file COPYING3. If not see | |
18 | <http://www.gnu.org/licenses/>. */ | |
19 | ||
20 | #ifndef GCC_REGRENAME_H | |
21 | #define GCC_REGRENAME_H | |
22 | ||
23 | /* We keep linked lists of DU_HEAD structures, each of which describes | |
24 | a chain of occurrences of a reg. */ | |
6c1dae73 | 25 | class du_head |
1f234b83 | 26 | { |
6c1dae73 | 27 | public: |
1f234b83 BS |
28 | /* The next chain. */ |
29 | struct du_head *next_chain; | |
30 | /* The first and last elements of this chain. */ | |
31 | struct du_chain *first, *last; | |
0d20a76b RS |
32 | /* The chain that this chain is tied to. */ |
33 | struct du_head *tied_chain; | |
1f234b83 BS |
34 | /* Describes the register being tracked. */ |
35 | unsigned regno; | |
36 | int nregs; | |
37 | ||
38 | /* A unique id to be used as an index into the conflicts bitmaps. */ | |
39 | unsigned id; | |
40 | /* A bitmap to record conflicts with other chains. */ | |
41 | bitmap_head conflicts; | |
42 | /* Conflicts with untracked hard registers. */ | |
43 | HARD_REG_SET hard_conflicts; | |
44 | ||
45 | /* Nonzero if the chain crosses a call. */ | |
46 | unsigned int need_caller_save_reg:1; | |
47 | /* Nonzero if the register is used in a way that prevents renaming, | |
48 | such as the SET_DEST of a CALL_INSN or an asm operand that used | |
49 | to be a hard register. */ | |
50 | unsigned int cannot_rename:1; | |
0d20a76b RS |
51 | /* Nonzero if the chain has already been renamed. */ |
52 | unsigned int renamed:1; | |
d085c468 BS |
53 | |
54 | /* Fields for use by target code. */ | |
55 | unsigned int target_data_1; | |
56 | unsigned int target_data_2; | |
1f234b83 BS |
57 | }; |
58 | ||
59 | typedef struct du_head *du_head_p; | |
1f234b83 BS |
60 | |
61 | /* This struct describes a single occurrence of a register. */ | |
62 | struct du_chain | |
63 | { | |
64 | /* Links to the next occurrence of the register. */ | |
65 | struct du_chain *next_use; | |
66 | ||
67 | /* The insn where the register appears. */ | |
186294fa | 68 | rtx_insn *insn; |
1f234b83 BS |
69 | /* The location inside the insn. */ |
70 | rtx *loc; | |
71 | /* The register class required by the insn at this location. */ | |
72 | ENUM_BITFIELD(reg_class) cl : 16; | |
73 | }; | |
74 | ||
75 | /* This struct describes data gathered during regrename_analyze about | |
76 | a single operand of an insn. */ | |
84562394 | 77 | struct operand_rr_info |
1f234b83 BS |
78 | { |
79 | /* The number of chains recorded for this operand. */ | |
d534bf56 BS |
80 | short n_chains; |
81 | bool failed; | |
1f234b83 BS |
82 | /* Holds either the chain for the operand itself, or for the registers in |
83 | a memory operand. */ | |
84 | struct du_chain *chains[MAX_REGS_PER_ADDRESS]; | |
85 | struct du_head *heads[MAX_REGS_PER_ADDRESS]; | |
84562394 | 86 | }; |
1f234b83 BS |
87 | |
88 | /* A struct to hold a vector of operand_rr_info structures describing the | |
89 | operands of an insn. */ | |
84562394 | 90 | struct insn_rr_info |
1f234b83 BS |
91 | { |
92 | operand_rr_info *op_info; | |
84562394 | 93 | }; |
1f234b83 | 94 | |
1f234b83 | 95 | |
9771b263 | 96 | extern vec<insn_rr_info> insn_rr; |
1f234b83 BS |
97 | |
98 | extern void regrename_init (bool); | |
99 | extern void regrename_finish (void); | |
100 | extern void regrename_analyze (bitmap); | |
101 | extern du_head_p regrename_chain_from_id (unsigned int); | |
63edbb04 TP |
102 | extern int find_rename_reg (du_head_p, enum reg_class, HARD_REG_SET *, int, |
103 | bool); | |
17369fbf | 104 | extern bool regrename_do_replace (du_head_p, int); |
211c9305 BS |
105 | extern reg_class regrename_find_superclass (du_head_p, int *, |
106 | HARD_REG_SET *); | |
1f234b83 BS |
107 | |
108 | #endif |