[all-commits] [llvm/llvm-project] 01a0d2: [flang][acc] Implement MappableType interfaces for...

Razvan Lupusoru via All-commits all-commits at lists.llvm.org
Tue Jan 14 10:43:19 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 01a0d212a64919205734706d929db37e503c35ce
      https://github.com/llvm/llvm-project/commit/01a0d212a64919205734706d929db37e503c35ce
  Author: Razvan Lupusoru <razvan.lupusoru at gmail.com>
  Date:   2025-01-14 (Tue, 14 Jan 2025)

  Changed paths:
    A flang/include/flang/Optimizer/OpenACC/FIROpenACCTypeInterfaces.h
    A flang/include/flang/Optimizer/OpenACC/RegisterOpenACCExtensions.h
    M flang/include/flang/Optimizer/Support/InitFIR.h
    M flang/lib/Frontend/CMakeLists.txt
    M flang/lib/Optimizer/CMakeLists.txt
    M flang/lib/Optimizer/Dialect/CMakeLists.txt
    A flang/lib/Optimizer/OpenACC/CMakeLists.txt
    A flang/lib/Optimizer/OpenACC/FIROpenACCTypeInterfaces.cpp
    A flang/lib/Optimizer/OpenACC/RegisterOpenACCExtensions.cpp
    A flang/test/Fir/OpenACC/openacc-mappable.fir
    M flang/test/lib/CMakeLists.txt
    A flang/test/lib/OpenACC/CMakeLists.txt
    A flang/test/lib/OpenACC/TestOpenACCInterfaces.cpp
    M flang/tools/fir-lsp-server/CMakeLists.txt
    M flang/tools/fir-opt/CMakeLists.txt
    M flang/tools/fir-opt/fir-opt.cpp
    M flang/tools/tco/CMakeLists.txt

  Log Message:
  -----------
  [flang][acc] Implement MappableType interfaces for fir.box and fir.array (#122495)

The newly introduced MappableType interface in `acc` dialect was
primarily intended to allow variables with non-materialized storage to
be used in acc data clauses (previously everything was required to be
`pointer-like`). One motivator for this was `fir.box` since it is
possible to be passed to functions without a wrapping `fir.ref` and also
it can be generated directly via operations like `fir.embox` - and
unlike other variable representations in FIR, the underlying storage for
it does not get materialized until LLVM codegen.

The new interface is being attached to both `fir.box` and `fir.array`.
Strictly speaking, attaching to the latter is primarily for consistency
since the MappableType interface requires implementation of utilities to
compute byte size - and it made sense that a
`fir.box<fir.array<10xi32>>` and `fir.array<10xi32>` would have a
consistently computable size. This decision may be revisited as
MappableType interface evolves.

The new interface attachments are made in a new library named
`FIROpenACCSupport`. The reason for this is to avoid circular
dependencies since the implementation of this library is reusing code
from lowering of OpenACC. More specifically, the types are defined in
`FIRDialect` and `FortranLower` depends on it. Thus we cannot attach
these interfaces in `FIRDialect`.



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