annotate gcc/regrename.h @ 120:f93fa5091070

fix conv1.c
author mir3636
date Thu, 08 Mar 2018 14:53:42 +0900
parents 04ced10e8804
children 84e7813d76e9
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.
kono
parents:
diff changeset
2 Copyright (C) 2011-2017 Free Software Foundation, Inc.
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. */
kono
parents:
diff changeset
25 struct du_head
kono
parents:
diff changeset
26 {
kono
parents:
diff changeset
27 /* The next chain. */
kono
parents:
diff changeset
28 struct du_head *next_chain;
kono
parents:
diff changeset
29 /* The first and last elements of this chain. */
kono
parents:
diff changeset
30 struct du_chain *first, *last;
kono
parents:
diff changeset
31 /* The chain that this chain is tied to. */
kono
parents:
diff changeset
32 struct du_head *tied_chain;
kono
parents:
diff changeset
33 /* Describes the register being tracked. */
kono
parents:
diff changeset
34 unsigned regno;
kono
parents:
diff changeset
35 int nregs;
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 /* A unique id to be used as an index into the conflicts bitmaps. */
kono
parents:
diff changeset
38 unsigned id;
kono
parents:
diff changeset
39 /* A bitmap to record conflicts with other chains. */
kono
parents:
diff changeset
40 bitmap_head conflicts;
kono
parents:
diff changeset
41 /* Conflicts with untracked hard registers. */
kono
parents:
diff changeset
42 HARD_REG_SET hard_conflicts;
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 /* Nonzero if the chain crosses a call. */
kono
parents:
diff changeset
45 unsigned int need_caller_save_reg:1;
kono
parents:
diff changeset
46 /* Nonzero if the register is used in a way that prevents renaming,
kono
parents:
diff changeset
47 such as the SET_DEST of a CALL_INSN or an asm operand that used
kono
parents:
diff changeset
48 to be a hard register. */
kono
parents:
diff changeset
49 unsigned int cannot_rename:1;
kono
parents:
diff changeset
50 /* Nonzero if the chain has already been renamed. */
kono
parents:
diff changeset
51 unsigned int renamed:1;
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 /* Fields for use by target code. */
kono
parents:
diff changeset
54 unsigned int target_data_1;
kono
parents:
diff changeset
55 unsigned int target_data_2;
kono
parents:
diff changeset
56 };
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 typedef struct du_head *du_head_p;
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 /* This struct describes a single occurrence of a register. */
kono
parents:
diff changeset
61 struct du_chain
kono
parents:
diff changeset
62 {
kono
parents:
diff changeset
63 /* Links to the next occurrence of the register. */
kono
parents:
diff changeset
64 struct du_chain *next_use;
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 /* The insn where the register appears. */
kono
parents:
diff changeset
67 rtx_insn *insn;
kono
parents:
diff changeset
68 /* The location inside the insn. */
kono
parents:
diff changeset
69 rtx *loc;
kono
parents:
diff changeset
70 /* The register class required by the insn at this location. */
kono
parents:
diff changeset
71 ENUM_BITFIELD(reg_class) cl : 16;
kono
parents:
diff changeset
72 };
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 /* This struct describes data gathered during regrename_analyze about
kono
parents:
diff changeset
75 a single operand of an insn. */
kono
parents:
diff changeset
76 struct operand_rr_info
kono
parents:
diff changeset
77 {
kono
parents:
diff changeset
78 /* The number of chains recorded for this operand. */
kono
parents:
diff changeset
79 short n_chains;
kono
parents:
diff changeset
80 bool failed;
kono
parents:
diff changeset
81 /* Holds either the chain for the operand itself, or for the registers in
kono
parents:
diff changeset
82 a memory operand. */
kono
parents:
diff changeset
83 struct du_chain *chains[MAX_REGS_PER_ADDRESS];
kono
parents:
diff changeset
84 struct du_head *heads[MAX_REGS_PER_ADDRESS];
kono
parents:
diff changeset
85 };
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 /* A struct to hold a vector of operand_rr_info structures describing the
kono
parents:
diff changeset
88 operands of an insn. */
kono
parents:
diff changeset
89 struct insn_rr_info
kono
parents:
diff changeset
90 {
kono
parents:
diff changeset
91 operand_rr_info *op_info;
kono
parents:
diff changeset
92 };
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 extern vec<insn_rr_info> insn_rr;
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 extern void regrename_init (bool);
kono
parents:
diff changeset
98 extern void regrename_finish (void);
kono
parents:
diff changeset
99 extern void regrename_analyze (bitmap);
kono
parents:
diff changeset
100 extern du_head_p regrename_chain_from_id (unsigned int);
kono
parents:
diff changeset
101 extern int find_rename_reg (du_head_p, enum reg_class, HARD_REG_SET *, int,
kono
parents:
diff changeset
102 bool);
kono
parents:
diff changeset
103 extern bool regrename_do_replace (du_head_p, int);
kono
parents:
diff changeset
104 extern reg_class regrename_find_superclass (du_head_p, int *,
kono
parents:
diff changeset
105 HARD_REG_SET *);
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 #endif