tree-scalar-evolution.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Scalar evolution detector.
  2. Copyright (C) 2003-2019 Free Software Foundation, Inc.
  3. Contributed by Sebastian Pop <s.pop@laposte.net>
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it under
  6. the terms of the GNU General Public License as published by the Free
  7. Software Foundation; either version 3, or (at your option) any later
  8. version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with GCC; see the file COPYING3. If not see
  15. <http://www.gnu.org/licenses/>. */
  16. #ifndef GCC_TREE_SCALAR_EVOLUTION_H
  17. #define GCC_TREE_SCALAR_EVOLUTION_H
  18. extern tree number_of_latch_executions (struct loop *);
  19. extern gcond *get_loop_exit_condition (const struct loop *);
  20. extern void scev_initialize (void);
  21. extern bool scev_initialized_p (void);
  22. extern void scev_reset (void);
  23. extern void scev_reset_htab (void);
  24. extern void scev_finalize (void);
  25. extern tree analyze_scalar_evolution (struct loop *, tree);
  26. extern tree instantiate_scev (edge, struct loop *, tree);
  27. extern tree resolve_mixers (struct loop *, tree, bool *);
  28. extern void gather_stats_on_scev_database (void);
  29. extern bool final_value_replacement_loop (struct loop *);
  30. extern unsigned int scev_const_prop (void);
  31. extern bool expression_expensive_p (tree);
  32. extern bool simple_iv_with_niters (struct loop *, struct loop *, tree,
  33. struct affine_iv *, tree *, bool);
  34. extern bool simple_iv (struct loop *, struct loop *, tree, struct affine_iv *,
  35. bool);
  36. extern bool iv_can_overflow_p (struct loop *, tree, tree, tree);
  37. extern tree compute_overall_effect_of_inner_loop (struct loop *, tree);
  38. /* Returns the basic block preceding LOOP, or the CFG entry block when
  39. the loop is function's body. */
  40. static inline basic_block
  41. block_before_loop (loop_p loop)
  42. {
  43. edge preheader = loop_preheader_edge (loop);
  44. return (preheader ? preheader->src : ENTRY_BLOCK_PTR_FOR_FN (cfun));
  45. }
  46. /* Analyze all the parameters of the chrec that were left under a
  47. symbolic form. LOOP is the loop in which symbolic names have to
  48. be analyzed and instantiated. */
  49. static inline tree
  50. instantiate_parameters (struct loop *loop, tree chrec)
  51. {
  52. return instantiate_scev (loop_preheader_edge (loop), loop, chrec);
  53. }
  54. /* Returns the loop of the polynomial chrec CHREC. */
  55. static inline struct loop *
  56. get_chrec_loop (const_tree chrec)
  57. {
  58. return get_loop (cfun, CHREC_VARIABLE (chrec));
  59. }
  60. #endif /* GCC_TREE_SCALAR_EVOLUTION_H */