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