[flang][hlfir] inline hlfir.transpose as hlfir.elemental
authorTom Eccles <tom.eccles@arm.com>
Tue, 25 Apr 2023 12:24:46 +0000 (12:24 +0000)
committerTom Eccles <tom.eccles@arm.com>
Tue, 25 Apr 2023 12:43:48 +0000 (12:43 +0000)
commit64ea60e8039e3f65707ee4179aeeb8915d0fb32d
treee4babd0f58ae5afeb6cec55d5354a222869ab354
parent5156d1a797be2c4a6af40fb33a574c3d379196ae
[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
flang/include/flang/Optimizer/Builder/HLFIRTools.h
flang/include/flang/Optimizer/HLFIR/Passes.h
flang/include/flang/Optimizer/HLFIR/Passes.td
flang/include/flang/Tools/CLOptions.inc
flang/lib/Optimizer/Builder/HLFIRTools.cpp
flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp [new file with mode: 0644]
flang/test/Driver/mlir-pass-pipeline.f90
flang/test/Fir/basic-program.fir
flang/test/HLFIR/simplify-hlfir-intrinsics.fir [new file with mode: 0644]