[all-commits] [llvm/llvm-project] 47f759: [fir] Add array value copy pass

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Tue Nov 30 04:51:29 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 47f759309eeaf9bd77debe4f6c3e1fe52913b537
      https://github.com/llvm/llvm-project/commit/47f759309eeaf9bd77debe4f6c3e1fe52913b537
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2021-11-30 (Tue, 30 Nov 2021)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/FIRBuilder.h
    M flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h
    M flang/include/flang/Optimizer/Dialect/FIROpsSupport.h
    M flang/include/flang/Optimizer/Dialect/FIRTypes.td
    A flang/include/flang/Optimizer/Transforms/Factory.h
    M flang/include/flang/Optimizer/Transforms/Passes.h
    M flang/include/flang/Optimizer/Transforms/Passes.td
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    A flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp
    M flang/lib/Optimizer/Transforms/CMakeLists.txt
    A flang/test/Fir/array-value-copy.fir
    M flang/test/Fir/invalid.fir
    M flang/unittests/Optimizer/Builder/FIRBuilderTest.cpp

  Log Message:
  -----------
  [fir] Add array value copy pass

This patch upstream the array value copy pass.

Transform the set of array value primitives to a memory-based array
representation.

The Ops `array_load`, `array_store`, `array_fetch`, and `array_update` are
used to manage abstract aggregate array values. A simple analysis is done
to determine if there are potential dependences between these operations.
If not, these array operations can be lowered to work directly on the memory
representation. If there is a potential conflict, a temporary is created
along with appropriate copy-in/copy-out operations. Here, a more refined
analysis might be deployed, such as using the affine framework.

This pass is required before code gen to the LLVM IR dialect.

This patch is part of the upstreaming effort from fir-dev branch. The
pass is bringing quite a lot of file with it.

Reviewed By: kiranchandramohan, schweitz

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

Co-authored-by: Jean Perier <jperier at nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz at nvidia.com>
Co-authored-by: V Donaldson <vdonaldson at nvidia.com>




More information about the All-commits mailing list