[all-commits] [llvm/llvm-project] 5156d1: [flang][hlfir] get constant extents when possible

Tom Eccles via All-commits all-commits at lists.llvm.org
Tue Apr 25 05:45:18 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5156d1a797be2c4a6af40fb33a574c3d379196ae
      https://github.com/llvm/llvm-project/commit/5156d1a797be2c4a6af40fb33a574c3d379196ae
  Author: Tom Eccles <tom.eccles at arm.com>
  Date:   2023-04-25 (Tue, 25 Apr 2023)

  Changed paths:
    M flang/lib/Optimizer/Builder/HLFIRTools.cpp
    M flang/test/HLFIR/extents-of-shape-of.f90

  Log Message:
  -----------
  [flang][hlfir] get constant extents when possible

If we know the extent at compile time, it is better to generate an
arith.constant than hlfir.get_extent. This gives more information earlier
in compilation (before hflir.get_extent is lowered).

Reviewed By: jeanPerier

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


  Commit: 64ea60e8039e3f65707ee4179aeeb8915d0fb32d
      https://github.com/llvm/llvm-project/commit/64ea60e8039e3f65707ee4179aeeb8915d0fb32d
  Author: Tom Eccles <tom.eccles at arm.com>
  Date:   2023-04-25 (Tue, 25 Apr 2023)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/HLFIRTools.h
    M flang/include/flang/Optimizer/HLFIR/Passes.h
    M flang/include/flang/Optimizer/HLFIR/Passes.td
    M flang/include/flang/Tools/CLOptions.inc
    M flang/lib/Optimizer/Builder/HLFIRTools.cpp
    M flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
    A flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp
    M flang/test/Driver/mlir-pass-pipeline.f90
    M flang/test/Fir/basic-program.fir
    A flang/test/HLFIR/simplify-hlfir-intrinsics.fir

  Log Message:
  -----------
  [flang][hlfir] inline hlfir.transpose as hlfir.elemental

Inlining as a hlfir.elemental will allow the transpose to be inlined
into subsequent operations in some cases. For example,

y = TRANSPOSE(x)
z = y * 2

Will operate in a single loop without creating a temporary for the
TRANSPOSE (unlike the runtime call, which always allocates).

This is in a new SimplifyHLFIRIntriniscs pass. The intention is that some
day that pass might replace the FIR SimplifyIntrinsics pass.

Depends On: D149060

Reviewed By: jeanPerier, vzakhari

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


Compare: https://github.com/llvm/llvm-project/compare/f39678dfbf2c...64ea60e8039e


More information about the All-commits mailing list