LoopIdiomRecognize.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //===- LoopIdiomRecognize.h - Loop Idiom Recognize Pass ---------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This pass implements an idiom recognizer that transforms simple loops into a
  10. // non-loop form. In cases that this kicks in, it can be a significant
  11. // performance win.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_TRANSFORMS_SCALAR_LOOPIDIOMRECOGNIZE_H
  15. #define LLVM_TRANSFORMS_SCALAR_LOOPIDIOMRECOGNIZE_H
  16. #include "llvm/Analysis/LoopAnalysisManager.h"
  17. #include "llvm/IR/PassManager.h"
  18. namespace llvm {
  19. class Loop;
  20. class LPMUpdater;
  21. /// Options to disable Loop Idiom Recognize, which can be shared with other
  22. /// passes.
  23. struct DisableLIRP {
  24. /// When true, the entire pass is disabled.
  25. static bool All;
  26. /// When true, Memset is disabled.
  27. static bool Memset;
  28. /// When true, Memcpy is disabled.
  29. static bool Memcpy;
  30. };
  31. /// Performs Loop Idiom Recognize Pass.
  32. class LoopIdiomRecognizePass : public PassInfoMixin<LoopIdiomRecognizePass> {
  33. public:
  34. PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
  35. LoopStandardAnalysisResults &AR, LPMUpdater &U);
  36. };
  37. } // end namespace llvm
  38. #endif // LLVM_TRANSFORMS_SCALAR_LOOPIDIOMRECOGNIZE_H