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