llvmorg-github-actions[bot] wrote:
@llvm/pr-subscribers-flang-driver
Author: Eugene Epshteyn (eugeneepshteyn)
Changes
Drop the user-facing options that selected the legacy non-HLFIR lowering
path, the always-true `LowerToHighLevelFIR` lowering option, and the
descriptor-discretization debug switch:
- `-flang-experimental-hlfir` and `-flang-deprecated-no-hlfir` (flang
driver and `-fc1`)
- `-hlfir` / `--hlfir` (bbc)
- `--use-desc-for-alloc` (bbc, debug)
Remove every `if (lowerToHighLevelFIR()) { ... } else { ... }` branch in
`lib/Lower/`, keeping the HLFIR side. Delete the now-unused legacy
helpers in `Bridge.cpp` (`copyVarFIR`, both `genNoHLFIRPointerAssignment`
overloads, the legacy block of `genAssignment`) and the always-empty
`createMutableProperties` together with its four dead helpers in
`Allocatable.cpp`. Drop the corresponding `alwaysUseBox` parameter from
`createMutableBox`.
Note: tests were modified in https://github.com/llvm/llvm-project/pull/196137
Assisted-by: AI
---
Patch is 76.46 KiB, truncated to 20.00 KiB below, full version:
https://github.com/llvm/llvm-project/pull/196205.diff
15 Files Affected:
- (modified) clang/include/clang/Options/FlangOptions.td (-12)
- (modified) clang/lib/Driver/ToolChains/Flang.cpp (-2)
- (modified) flang/include/flang/Lower/Allocatable.h (+6-5)
- (modified) flang/include/flang/Lower/LoweringOptions.def (-3)
- (modified) flang/lib/Frontend/CompilerInvocation.cpp (-19)
- (modified) flang/lib/Frontend/FrontendActions.cpp (+1-7)
- (modified) flang/lib/Lower/Allocatable.cpp (+5-139)
- (modified) flang/lib/Lower/Bridge.cpp (+100-564)
- (modified) flang/lib/Lower/CallInterface.cpp (+1-10)
- (modified) flang/lib/Lower/ConvertCall.cpp (+7-13)
- (modified) flang/lib/Lower/ConvertConstant.cpp (-12)
- (modified) flang/lib/Lower/ConvertType.cpp (+1-29)
- (modified) flang/lib/Lower/ConvertVariable.cpp (+28-80)
- (modified) flang/lib/Lower/HostAssociations.cpp (+2-5)
- (modified) flang/tools/bbc/bbc.cpp (+1-6)
``diff
diff --git a/clang/include/clang/Options/FlangOptions.td
b/clang/include/clang/Options/FlangOptions.td
index 1ab83b6ffbbad..50e4642358b71 100644
--- a/clang/include/clang/Options/FlangOptions.td
+++ b/clang/include/clang/Options/FlangOptions.td
@@ -114,18 +114,6 @@ def static_libflangrt : Flag<["-"], "static-libflangrt">,
HelpText<"Link the flang-rt static library">, Group,
Visibility<[FlangOption]>, Flags<[NoArgumentUnused]>;
-//===--===//
-// FlangOption + NoXarchOption
-//===--===//
-
-def flang_experimental_hlfir : Flag<["-"], "flang-experimental-hlfir">,
- Flags<[HelpHidden]>, Visibility<[FlangOption, FC1Option]>,
- HelpText<"Use HLFIR lowering (experimental)">;
-
-def flang_deprecated_no_hlfir : Flag<["-"], "flang-deprecated-no-hlfir">,
- Flags<[HelpHidden]>, Visibility<[FlangOption, FC1Option]>,
- HelpText<"Do not use HLFIR lowering (deprecated)">;
-
//===--===//
// FlangOption + CoreOption + NoXarchOption
//===--===//
diff --git a/clang/lib/Driver/ToolChains/Flang.cpp
b/clang/lib/Driver/ToolChains/Flang.cpp
index ce503b74295e4..082df7beb4b85 100644
--- a/clang/lib/Driver/ToolChains/Flang.cpp
+++ b/clang/lib/Driver/ToolChains/Flang.cpp
@@ -252,8 +252,6 @@ void Flang::addCodegenOptions(const ArgList &Args,
Args.addAllArgs(
CmdArgs,
{options::OPT_fdo_concurrent_to_openmp_EQ,
- options::OPT_flang_experimental_hlfir,
- options::OPT_flang_deprecated_no_hlfir,
options::OPT_fno_ppc_native_vec_elem_order,
options::OPT_fppc_native_vec_elem_order, options::OPT_finit_global_zero,
options::OPT_fno_init_global_zero, options::OPT_frepack_arrays,
diff --git a/flang/include/flang/Lower/Allocatable.h
b/flang/include/flang/Lower/Allocatable.h
index 0e89af94af40f..515fd20b2bcb5 100644
--- a/flang/include/flang/Lower/Allocatable.h
+++ b/flang/include/flang/Lower/Allocatable.h
@@ -68,11 +68,12 @@ void genDeallocateIfAllocated(AbstractConverter &converter,
/// Create a MutableBoxValue for an allocatable or pointer entity.
/// If the variables is a local variable that is not a dummy, it will be
/// initialized to unallocated/diassociated status.
-fir::MutableBoxValue
-createMutableBox(AbstractConverter &converter, mlir::Location loc,
- const pft::Variable &var, mlir::Value boxAddr,
- mlir::ValueRange nonDeferredParams, bool alwaysUseBox,
- unsigned allocator = kDefaultAllocator);
+fir::MutableBoxValue createMutableBox(AbstractConverter &converter,
+ mlir::Location loc,
+ const pft::Variable &var,
+ mlir::Value boxAddr,
+