[all-commits] [llvm/llvm-project] 742bab: [MLIR][OpenMP][Flang] Normalize clause arguments n...

Sergio Afonso via All-commits all-commits at lists.llvm.org
Fri Jul 26 02:44:38 PDT 2024


  Branch: refs/heads/users/skatrak/normalize-clauses-02-names
  Home:   https://github.com/llvm/llvm-project
  Commit: 742bab2c6ea39b7e516036dac717015bbf443a9c
      https://github.com/llvm/llvm-project/commit/742bab2c6ea39b7e516036dac717015bbf443a9c
  Author: Sergio Afonso <safonsof at amd.com>
  Date:   2024-07-26 (Fri, 26 Jul 2024)

  Changed paths:
    M flang/lib/Lower/OpenMP/ClauseProcessor.cpp
    M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    M flang/lib/Optimizer/Transforms/OMPMapInfoFinalization.cpp
    M mlir/include/mlir/Dialect/OpenMP/OpenMPClauseOperands.h
    M mlir/include/mlir/Dialect/OpenMP/OpenMPClauses.td
    M mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
    M mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td
    M mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
    M mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Dialect/OpenMP/invalid.mlir
    M mlir/test/Dialect/OpenMP/ops.mlir
    M mlir/test/Target/LLVMIR/openmp-llvm.mlir

  Log Message:
  -----------
  [MLIR][OpenMP][Flang] Normalize clause arguments names

Currently, there are some inconsistencies to how clause arguments are named in
the OpenMP dialect. Additionally, the clause operand structures associated to
them also diverge in certain cases. The purpose of this patch is to normalize
argument names across all `OpenMP_Clause` tablegen definitions and clause
operand structures.

This has the benefit of providing more consistent representations for clauses
in the dialect, but the main short-term advantage is that it enables the
development of an OpenMP-specific tablegen backend to automatically generate
the clause operand structures without breaking dependent code.

The main re-naming decisions made in this patch are the following:
  - Variadic arguments (i.e. multiple values) have the "_vars" suffix. This
and other similar suffixes are removed from array attribute arguments.
  - Individual required or optional value arguments do not have any suffix
added to them (e.g. "val", "var", "expr", ...), except for `if` which would
otherwise result in an invalid C++ variable name.
  - The associated clause's name is prepended to argument names that don't
already contain it as part of its name. This avoids future collisions between
arguments named the same way on different clauses and adding both clauses to
the same operation.
  - Privatization and reduction related arguments that contain lists of symbols
pointing to privatizer/reducer operations use the "_syms" suffix. This removes
the inconsistencies between the names for "copyprivate_funcs",
"[in]reductions", "privatizers", etc.
  - General improvements to names, replacement of camel case for snake case
everywhere, etc.
  - Renaming of operation-associated operand structures to use the "Operands"
suffix in place of "ClauseOps", to better differentiate between clause operand
structures and operation operand structures.
  - Fields on clause operand structures are sorted according to the tablegen
definition of the same clause.

The assembly format for a few arguments is updated to better reflect the clause
they are associated with:
  - `chunk_size` -> `dist_schedule_chunk_size`
  - `grain_size` -> `grainsize`
  - `simd` -> `par_level_simd`



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