LoopRotationUtils.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- LoopRotationUtils.h - Utilities to perform loop rotation -*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file provides utilities to convert a loop into a loop with bottom test.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
  18. #define LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
  19. namespace llvm {
  20. class AssumptionCache;
  21. class DominatorTree;
  22. class Loop;
  23. class LoopInfo;
  24. class MemorySSAUpdater;
  25. class ScalarEvolution;
  26. struct SimplifyQuery;
  27. class TargetTransformInfo;
  28. /// Convert a loop into a loop with bottom test. It may
  29. /// perform loop latch simplication as well if the flag RotationOnly
  30. /// is false. The flag Threshold represents the size threshold of the loop
  31. /// header. If the loop header's size exceeds the threshold, the loop rotation
  32. /// will give up. The flag IsUtilMode controls the heuristic used in the
  33. /// LoopRotation. If it is true, the profitability heuristic will be ignored.
  34. bool LoopRotation(Loop *L, LoopInfo *LI, const TargetTransformInfo *TTI,
  35. AssumptionCache *AC, DominatorTree *DT, ScalarEvolution *SE,
  36. MemorySSAUpdater *MSSAU, const SimplifyQuery &SQ,
  37. bool RotationOnly, unsigned Threshold, bool IsUtilMode,
  38. bool PrepareForLTO = false);
  39. } // namespace llvm
  40. #endif
  41. #ifdef __GNUC__
  42. #pragma GCC diagnostic pop
  43. #endif