FlattenAlgo.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //===------ FlattenAlgo.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. // Main algorithm of the FlattenSchedulePass. This is a separate file to avoid
  10. // the unittest for this requiring linking against LLVM.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef POLLY_FLATTENALGO_H
  14. #define POLLY_FLATTENALGO_H
  15. #include "isl/isl-noexceptions.h"
  16. namespace polly {
  17. /// Recursively flatten a schedule.
  18. ///
  19. /// Reduce the number of scatter dimensions as much as possible without changing
  20. /// the relative order of instances in a schedule. Ideally, this results in a
  21. /// single scatter dimension, but it may not always be possible to combine
  22. /// dimensions, eg. if a dimension is unbounded. In worst case, the original
  23. /// schedule is returned.
  24. ///
  25. /// Schedules with fewer dimensions may be easier to understand for humans, but
  26. /// it should make no difference to the computer.
  27. ///
  28. /// @param Schedule The input schedule.
  29. ///
  30. /// @return The flattened schedule.
  31. isl::union_map flattenSchedule(isl::union_map Schedule);
  32. } // namespace polly
  33. #endif /* POLLY_FLATTENALGO_H */