[all-commits] [llvm/llvm-project] 07a6be: [Clang][OpenMP] Emit dependent PreInits before dir...

Michael Kruse via All-commits all-commits at lists.llvm.org
Wed Jun 2 14:59:52 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 07a6beb402150d25ec7c93a5747520ac2804731d
      https://github.com/llvm/llvm-project/commit/07a6beb402150d25ec7c93a5747520ac2804731d
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2021-06-02 (Wed, 02 Jun 2021)

  Changed paths:
    M clang/include/clang/AST/StmtOpenMP.h
    M clang/lib/AST/StmtOpenMP.cpp
    M clang/lib/CodeGen/CGStmtOpenMP.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/test/OpenMP/tile_codegen.cpp
    A clang/test/OpenMP/tile_codegen_for_dependent.cpp
    A clang/test/OpenMP/tile_codegen_tile_for.cpp

  Log Message:
  -----------
  [Clang][OpenMP] Emit dependent PreInits before directive.

The PreInits of a loop transformation (atm moment only tile) include the computation of the trip count. The trip count is needed by any loop-associated directives that consumes the transformation-generated loop. Hence, we must ensure that the PreInits of consumed loop transformations are emitted with the consuming directive.

This is done by addinging the inner loop transformation's PreInits to the outer loop-directive's PreInits. The outer loop-directive will consume the de-sugared AST such that the inner PreInits are not emitted twice. The PreInits of a loop transformation are still emitted directly if its generated loop(s) are not associated with another loop-associated directive.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D102180




More information about the All-commits mailing list