LoopStrengthReduce.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- LoopStrengthReduce.h - Loop Strength Reduce 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 transformation analyzes and transforms the induction variables (and
  15. // computations derived from them) into forms suitable for efficient execution
  16. // on the target.
  17. //
  18. // This pass performs a strength reduction on array references inside loops that
  19. // have as one or more of their components the loop induction variable, it
  20. // rewrites expressions to take advantage of scaled-index addressing modes
  21. // available on the target, and it performs a variety of other optimizations
  22. // related to loop induction variables.
  23. //
  24. //===----------------------------------------------------------------------===//
  25. #ifndef LLVM_TRANSFORMS_SCALAR_LOOPSTRENGTHREDUCE_H
  26. #define LLVM_TRANSFORMS_SCALAR_LOOPSTRENGTHREDUCE_H
  27. #include "llvm/Analysis/LoopAnalysisManager.h"
  28. #include "llvm/IR/PassManager.h"
  29. namespace llvm {
  30. class Loop;
  31. class LPMUpdater;
  32. /// Performs Loop Strength Reduce Pass.
  33. class LoopStrengthReducePass : public PassInfoMixin<LoopStrengthReducePass> {
  34. public:
  35. PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
  36. LoopStandardAnalysisResults &AR, LPMUpdater &U);
  37. };
  38. } // end namespace llvm
  39. #endif // LLVM_TRANSFORMS_SCALAR_LOOPSTRENGTHREDUCE_H
  40. #ifdef __GNUC__
  41. #pragma GCC diagnostic pop
  42. #endif