Canonicalization.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //===--- Canonicalization.h - Set of canonicalization passes ----*- 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. #ifndef POLLY_CANONICALIZATION_H
  9. #define POLLY_CANONICALIZATION_H
  10. #include "llvm/Passes/PassBuilder.h"
  11. namespace llvm {
  12. namespace legacy {
  13. class PassManagerBase;
  14. }
  15. } // namespace llvm
  16. namespace polly {
  17. /// Schedule a set of canonicalization passes to prepare for Polly.
  18. ///
  19. /// The set of optimization passes was partially taken/copied from the
  20. /// set of default optimization passes in LLVM. It is used to bring the code
  21. /// into a canonical form that simplifies the analysis and optimization passes
  22. /// of Polly. The set of optimization passes scheduled here is probably not yet
  23. /// optimal. TODO: Optimize the set of canonicalization passes.
  24. void registerCanonicalicationPasses(llvm::legacy::PassManagerBase &PM);
  25. llvm::FunctionPassManager
  26. buildCanonicalicationPassesForNPM(llvm::ModulePassManager &MPM,
  27. llvm::PassBuilder::OptimizationLevel Level);
  28. } // namespace polly
  29. #endif