[flang] [llvm] [mlir] [flang][OpenMP] Enable tiling (PR #143715)
Michael Kruse via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 8 08:16:36 PDT 2025
================
@@ -38,14 +59,21 @@ namespace lower {
namespace omp {
int64_t getCollapseValue(const List<Clause> &clauses) {
- auto iter = llvm::find_if(clauses, [](const Clause &clause) {
- return clause.id == llvm::omp::Clause::OMPC_collapse;
- });
- if (iter != clauses.end()) {
- const auto &collapse = std::get<clause::Collapse>(iter->u);
- return evaluate::ToInt64(collapse.v).value();
+ int64_t collapseValue = 1;
+ int64_t numTileSizes = 0;
+ for (auto &clause : clauses) {
+ if (clause.id == llvm::omp::Clause::OMPC_collapse) {
+ const auto &collapse = std::get<clause::Collapse>(clause.u);
+ collapseValue = evaluate::ToInt64(collapse.v).value();
+ } else if (clause.id == llvm::omp::Clause::OMPC_sizes) {
+ const auto &sizes = std::get<clause::Sizes>(clause.u);
+ numTileSizes = sizes.v.size();
+ }
----------------
Meinersbur wrote:
This mixes the directive that collapse goes on (DO, DISTRIBUTE, ..) and those sizes goes on (TILE). During resolving merge conflicts of #145917 and #144785 the approach of handling tile like a compound construct already caused problems. E.g. it could be `tile` twice with different `sizes`, or `unroll partial` followed by `tile` vs the other way around, and there is no way to disambiguate them.
So it will need to be tangled apart eventually, and I would appreciate if we could avoid the assumption that there is just one `tile` which is always first.
https://github.com/llvm/llvm-project/pull/143715
More information about the llvm-commits
mailing list