DeLICM.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //===------ DeLICM.h --------------------------------------------*- 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. // Undo the effect of Loop Invariant Code Motion (LICM) and
  10. // GVN Partial Redundancy Elimination (PRE) on SCoP-level.
  11. //
  12. // Namely, remove register/scalar dependencies by mapping them back to array
  13. // elements.
  14. //
  15. //===----------------------------------------------------------------------===//
  16. #ifndef POLLY_DELICM_H
  17. #define POLLY_DELICM_H
  18. #include "polly/ScopPass.h"
  19. #include "isl/isl-noexceptions.h"
  20. namespace llvm {
  21. class PassRegistry;
  22. class Pass;
  23. class raw_ostream;
  24. } // namespace llvm
  25. namespace polly {
  26. /// Create a new DeLICM pass instance.
  27. llvm::Pass *createDeLICMWrapperPass();
  28. struct DeLICMPass : llvm::PassInfoMixin<DeLICMPass> {
  29. DeLICMPass() {}
  30. llvm::PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
  31. ScopStandardAnalysisResults &SAR, SPMUpdater &U);
  32. };
  33. struct DeLICMPrinterPass : llvm::PassInfoMixin<DeLICMPrinterPass> {
  34. DeLICMPrinterPass(raw_ostream &OS) : OS(OS) {}
  35. PreservedAnalyses run(Scop &S, ScopAnalysisManager &,
  36. ScopStandardAnalysisResults &SAR, SPMUpdater &);
  37. private:
  38. llvm::raw_ostream &OS;
  39. };
  40. /// Determine whether two lifetimes are conflicting.
  41. ///
  42. /// Used by unittesting.
  43. bool isConflicting(isl::union_set ExistingOccupied,
  44. isl::union_set ExistingUnused, isl::union_map ExistingKnown,
  45. isl::union_map ExistingWrites,
  46. isl::union_set ProposedOccupied,
  47. isl::union_set ProposedUnused, isl::union_map ProposedKnown,
  48. isl::union_map ProposedWrites,
  49. llvm::raw_ostream *OS = nullptr, unsigned Indent = 0);
  50. } // namespace polly
  51. namespace llvm {
  52. void initializeDeLICMWrapperPassPass(llvm::PassRegistry &);
  53. } // namespace llvm
  54. #endif /* POLLY_DELICM_H */