[all-commits] [llvm/llvm-project] b0b6c1: [Clang][OpenMP][Tile] Allow non-constant tile size...

Michael Kruse via All-commits all-commits at lists.llvm.org
Mon May 13 07:11:20 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b0b6c16b470a7d5d9c63765058cca0ebe07ad57d
      https://github.com/llvm/llvm-project/commit/b0b6c16b470a7d5d9c63765058cca0ebe07ad57d
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2024-05-13 (Mon, 13 May 2024)

  Changed paths:
    M clang/include/clang/Parse/Parser.h
    M clang/lib/Parse/ParseOpenMP.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/test/OpenMP/tile_ast_print.cpp
    M clang/test/OpenMP/tile_codegen.cpp
    M clang/test/OpenMP/tile_messages.cpp
    A openmp/runtime/test/transform/tile/intfor.c
    A openmp/runtime/test/transform/tile/negtile_intfor.c
    A openmp/runtime/test/transform/tile/parallel-wsloop-collapse-intfor.cpp

  Log Message:
  -----------
  [Clang][OpenMP][Tile] Allow non-constant tile sizes. (#91345)

Allow non-constants in the `sizes` clause such as
```
#pragma omp tile sizes(a)
for (int i = 0; i < n; ++i)
```
This is permitted since tile was introduced in [OpenMP
5.1](https://www.openmp.org/spec-html/5.1/openmpsu53.html#x78-860002.11.9).

It is possible to sneak-in negative numbers at runtime as in
```
int a = -1;
#pragma omp tile sizes(a)
```
Even though it is not well-formed, it should still result in every loop
iteration to be executed exactly once, an invariant of the tile
construct that we should ensure. `ParseOpenMPExprListClause` is
extracted-out to be reused by the `permutation` clause of the
`interchange` construct. Some care was put into ensuring correct behavior
in template contexts.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list