resource.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* Definitions for computing resource usage of specific insns.
  2. Copyright (C) 1999-2019 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. /* Macro to clear all resources. */
  18. #define CLEAR_RESOURCE(RES) \
  19. do { (RES)->memory = (RES)->volatil = (RES)->cc = 0; \
  20. CLEAR_HARD_REG_SET ((RES)->regs); } while (0)
  21. /* The resources used by a given insn. */
  22. struct resources
  23. {
  24. char memory; /* Insn sets or needs a memory location. */
  25. char volatil; /* Insn sets or needs a volatile memory loc. */
  26. char cc; /* Insn sets or needs the condition codes. */
  27. HARD_REG_SET regs; /* Which registers are set or needed. */
  28. };
  29. /* The kinds of rtl mark_*_resources will consider */
  30. enum mark_resource_type
  31. {
  32. MARK_SRC_DEST = 0,
  33. MARK_SRC_DEST_CALL = 1
  34. };
  35. extern void mark_target_live_regs (rtx_insn *, rtx, struct resources *);
  36. extern void mark_set_resources (rtx, struct resources *, int,
  37. enum mark_resource_type);
  38. extern void mark_referenced_resources (rtx, struct resources *, bool);
  39. extern void clear_hashed_info_for_insn (rtx_insn *);
  40. extern void clear_hashed_info_until_next_barrier (rtx_insn *);
  41. extern void incr_ticks_for_insn (rtx_insn *);
  42. extern void mark_end_of_function_resources (rtx, bool);
  43. extern void init_resource_info (rtx_insn *);
  44. extern void free_resource_info (void);
  45. #endif /* GCC_RESOURCE_H */