]>
Commit | Line | Data |
---|---|---|
ca545bb5 | 1 | /* Definitions for computing resource usage of specific insns. |
d652f226 | 2 | Copyright (C) 1999, 2003, 2004, 2006, 2007, 2009, 2010 |
675f99c9 | 3 | Free Software Foundation, Inc. |
ca545bb5 | 4 | |
1322177d | 5 | This file is part of GCC. |
ca545bb5 | 6 | |
1322177d LB |
7 | GCC is free software; you can redistribute it and/or modify it under |
8 | the terms of the GNU General Public License as published by the Free | |
9dcd6f09 | 9 | Software Foundation; either version 3, or (at your option) any later |
1322177d | 10 | version. |
ca545bb5 | 11 | |
1322177d LB |
12 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | for more details. | |
ca545bb5 BM |
16 | |
17 | You should have received a copy of the GNU General Public License | |
9dcd6f09 NC |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
ca545bb5 | 20 | |
59587b18 JQ |
21 | #ifndef GCC_RESOURCE_H |
22 | #define GCC_RESOURCE_H | |
23 | ||
24 | #include "hard-reg-set.h" | |
6fb5fa3c | 25 | #include "df.h" |
59587b18 | 26 | |
ca545bb5 BM |
27 | /* Macro to clear all resources. */ |
28 | #define CLEAR_RESOURCE(RES) \ | |
29 | do { (RES)->memory = (RES)->unch_memory = (RES)->volatil = (RES)->cc = 0; \ | |
30 | CLEAR_HARD_REG_SET ((RES)->regs); } while (0) | |
31 | ||
2ba84f36 | 32 | /* The resources used by a given insn. */ |
ca545bb5 BM |
33 | struct resources |
34 | { | |
35 | char memory; /* Insn sets or needs a memory location. */ | |
6d119d8f | 36 | char unch_memory; /* Insn sets or needs an "unchanging" MEM. */ |
ca545bb5 BM |
37 | char volatil; /* Insn sets or needs a volatile memory loc. */ |
38 | char cc; /* Insn sets or needs the condition codes. */ | |
39 | HARD_REG_SET regs; /* Which registers are set or needed. */ | |
40 | }; | |
41 | ||
73780b74 SC |
42 | /* The kinds of rtl mark_*_resources will consider */ |
43 | enum mark_resource_type | |
44 | { | |
45 | MARK_SRC_DEST = 0, | |
73fb6466 | 46 | MARK_SRC_DEST_CALL = 1 |
73780b74 SC |
47 | }; |
48 | ||
0c20a65f AJ |
49 | extern void mark_target_live_regs (rtx, rtx, struct resources *); |
50 | extern void mark_set_resources (rtx, struct resources *, int, | |
51 | enum mark_resource_type); | |
675f99c9 | 52 | extern void mark_referenced_resources (rtx, struct resources *, bool); |
0c20a65f AJ |
53 | extern void clear_hashed_info_for_insn (rtx); |
54 | extern void incr_ticks_for_insn (rtx); | |
675f99c9 | 55 | extern void mark_end_of_function_resources (rtx, bool); |
0c20a65f AJ |
56 | extern void init_resource_info (rtx); |
57 | extern void free_resource_info (void); | |
59587b18 JQ |
58 | |
59 | #endif /* GCC_RESOURCE_H */ |