LoopIdiomRecognize.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- LoopIdiomRecognize.h - Loop Idiom Recognize Pass ---------*- 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 pass implements an idiom recognizer that transforms simple loops into a
  15. // non-loop form. In cases that this kicks in, it can be a significant
  16. // performance win.
  17. //
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_TRANSFORMS_SCALAR_LOOPIDIOMRECOGNIZE_H
  20. #define LLVM_TRANSFORMS_SCALAR_LOOPIDIOMRECOGNIZE_H
  21. #include "llvm/Analysis/LoopAnalysisManager.h"
  22. #include "llvm/IR/PassManager.h"
  23. namespace llvm {
  24. class Loop;
  25. class LPMUpdater;
  26. /// Options to disable Loop Idiom Recognize, which can be shared with other
  27. /// passes.
  28. struct DisableLIRP {
  29. /// When true, the entire pass is disabled.
  30. static bool All;
  31. /// When true, Memset is disabled.
  32. static bool Memset;
  33. /// When true, Memcpy is disabled.
  34. static bool Memcpy;
  35. };
  36. /// Performs Loop Idiom Recognize Pass.
  37. class LoopIdiomRecognizePass : public PassInfoMixin<LoopIdiomRecognizePass> {
  38. public:
  39. PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
  40. LoopStandardAnalysisResults &AR, LPMUpdater &U);
  41. };
  42. } // end namespace llvm
  43. #endif // LLVM_TRANSFORMS_SCALAR_LOOPIDIOMRECOGNIZE_H
  44. #ifdef __GNUC__
  45. #pragma GCC diagnostic pop
  46. #endif