[flang] Avoid unnecessary temporaries in ArrayValueCopy.
authorSlava Zakharin <szakharin@nvidia.com>
Sat, 21 Jan 2023 03:58:36 +0000 (19:58 -0800)
committerSlava Zakharin <szakharin@nvidia.com>
Mon, 23 Jan 2023 20:33:37 +0000 (12:33 -0800)
commit59b18b5c91ec655189c73a123cb5204062601671
tree7b792861e9a272e6a76b114d1f6b45386087ba4a
parentc3737a6522306ba4504234afe35be8b0a4b7b48d
[flang] Avoid unnecessary temporaries in ArrayValueCopy.

Assume no conflict between pointer arrays and arrays without the target
attribute, if the fact of an array not having the target attribute
can be reliably computed.

This change speeds up SPEC CPU2017/527.cam from 2.5k seconds to 880 seconds
on Icelake, and makes further performance investigation easier.

Differential Revision: https://reviews.llvm.org/D142273
12 files changed:
flang/include/flang/Optimizer/Dialect/FIROpsSupport.h
flang/include/flang/Optimizer/Transforms/Passes.h
flang/include/flang/Optimizer/Transforms/Passes.td
flang/include/flang/Tools/CLOptions.inc
flang/lib/Optimizer/Dialect/FIROps.cpp
flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp
flang/test/Fir/array-copies-pointers.fir
flang/test/Fir/array-modify.fir
flang/test/Fir/array-value-copy-2.fir
flang/test/Fir/array-value-copy-3.fir
flang/test/Fir/array-value-copy-4.fir
flang/test/Fir/array-value-copy-cam4.fir [new file with mode: 0644]