annotate gcc/regrename.h @ 145:1830386684a0

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