LoopPeel.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #include "llvm/Transforms/Utils/ValueMapper.h"
  22. namespace llvm {
  23. bool canPeel(const Loop *L);
  24. /// VMap is the value-map that maps instructions from the original loop to
  25. /// instructions in the last peeled-off iteration.
  26. bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE,
  27. DominatorTree &DT, AssumptionCache *AC, bool PreserveLCSSA,
  28. ValueToValueMapTy &VMap);
  29. TargetTransformInfo::PeelingPreferences
  30. gatherPeelingPreferences(Loop *L, ScalarEvolution &SE,
  31. const TargetTransformInfo &TTI,
  32. std::optional<bool> UserAllowPeeling,
  33. std::optional<bool> UserAllowProfileBasedPeeling,
  34. bool UnrollingSpecficValues = false);
  35. void computePeelCount(Loop *L, unsigned LoopSize,
  36. TargetTransformInfo::PeelingPreferences &PP,
  37. unsigned TripCount, DominatorTree &DT,
  38. ScalarEvolution &SE, AssumptionCache *AC = nullptr,
  39. unsigned Threshold = UINT_MAX);
  40. } // end namespace llvm
  41. #endif // LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
  42. #ifdef __GNUC__
  43. #pragma GCC diagnostic pop
  44. #endif