resource.h revision 132718
1/* Definitions for computing resource usage of specific insns. 2 Copyright (C) 1999, 2003 Free Software Foundation, Inc. 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 2, 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 COPYING. If not, write to the Free 18Software Foundation, 59 Temple Place - Suite 330, Boston, MA 1902111-1307, USA. */ 20 21/* Macro to clear all resources. */ 22#define CLEAR_RESOURCE(RES) \ 23 do { (RES)->memory = (RES)->unch_memory = (RES)->volatil = (RES)->cc = 0; \ 24 CLEAR_HARD_REG_SET ((RES)->regs); } while (0) 25 26/* The resources used by a given insn. */ 27struct resources 28{ 29 char memory; /* Insn sets or needs a memory location. */ 30 char unch_memory; /* Insn sets of needs a "unchanging" MEM. */ 31 char volatil; /* Insn sets or needs a volatile memory loc. */ 32 char cc; /* Insn sets or needs the condition codes. */ 33 HARD_REG_SET regs; /* Which registers are set or needed. */ 34}; 35 36/* The kinds of rtl mark_*_resources will consider */ 37enum mark_resource_type 38{ 39 MARK_SRC_DEST = 0, 40 MARK_SRC_DEST_CALL = 1 41}; 42 43extern void mark_target_live_regs (rtx, rtx, struct resources *); 44extern void mark_set_resources (rtx, struct resources *, int, 45 enum mark_resource_type); 46extern void mark_referenced_resources (rtx, struct resources *, int); 47extern void clear_hashed_info_for_insn (rtx); 48extern void incr_ticks_for_insn (rtx); 49extern void mark_end_of_function_resources (rtx, int); 50extern void init_resource_info (rtx); 51extern void free_resource_info (void); 52