resource.h 1.9 KB

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