[flang] Propagate lowering options from driver.
authorSlava Zakharin <szakharin@nvidia.com>
Wed, 20 Jul 2022 03:39:58 +0000 (20:39 -0700)
committerSlava Zakharin <szakharin@nvidia.com>
Fri, 5 Aug 2022 18:29:45 +0000 (11:29 -0700)
commitf1eb945f9a5037b1fac6da02405047b24c0c2de5
tree65fe255cbe27f7b8ac2ececf5cbc1f91f0ed6935
parent9c81b743e31a7dca288b37b6cf6cca3213bfd923
[flang] Propagate lowering options from driver.

This commit addresses concerns raised in D129497.

Propagate lowering options from driver to expressions lowering
via AbstractConverter instance. A single use case so far is
using optimized TRANSPOSE lowering with O1/O2/O3.

bbc does not support optimization level switches, so it uses
default LoweringOptions (e.g. optimized TRANSPOSE lowering
is enabled by default, but an engineering -opt-transpose=false
option can still override this).

Differential Revision: https://reviews.llvm.org/D130204
12 files changed:
flang/include/flang/Frontend/CompilerInvocation.h
flang/include/flang/Lower/AbstractConverter.h
flang/include/flang/Lower/Bridge.h
flang/include/flang/Lower/LoweringOptions.h [new file with mode: 0644]
flang/lib/Frontend/CompilerInstance.cpp
flang/lib/Frontend/CompilerInvocation.cpp
flang/lib/Frontend/FrontendActions.cpp
flang/lib/Lower/Bridge.cpp
flang/lib/Lower/ConvertExpr.cpp
flang/test/Lower/Intrinsics/transpose.f90
flang/test/Lower/Intrinsics/transpose_opt.f90
flang/tools/bbc/bbc.cpp