LoopPeel.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- llvm/Transforms/Utils/LoopPeel.h ----- Peeling utilities -*- 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 defines some loop peeling utilities. It does not define any
  15. // actual pass or policy.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
  19. #define LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
  20. #include "llvm/Analysis/TargetTransformInfo.h"
  21. namespace llvm {
  22. bool canPeel(Loop *L);
  23. bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE,
  24. DominatorTree &DT, AssumptionCache *AC, bool PreserveLCSSA);
  25. TargetTransformInfo::PeelingPreferences
  26. gatherPeelingPreferences(Loop *L, ScalarEvolution &SE,
  27. const TargetTransformInfo &TTI,
  28. Optional<bool> UserAllowPeeling,
  29. Optional<bool> UserAllowProfileBasedPeeling,
  30. bool UnrollingSpecficValues = false);
  31. void computePeelCount(Loop *L, unsigned LoopSize,
  32. TargetTransformInfo::PeelingPreferences &PP,
  33. unsigned TripCount, DominatorTree &DT,
  34. ScalarEvolution &SE, unsigned Threshold = UINT_MAX);
  35. } // end namespace llvm
  36. #endif // LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
  37. #ifdef __GNUC__
  38. #pragma GCC diagnostic pop
  39. #endif