Skip to content

Commit 45884f1

Browse files
committed
Addressed review comments.
1 parent 4cce1a1 commit 45884f1

File tree

7 files changed

+10
-19
lines changed

7 files changed

+10
-19
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6974,7 +6974,7 @@ defm repack_arrays
69746974
" non-contiguous assumed shape dummy arrays into "
69756975
"contiguous memory">>,
69766976
DocBrief<[{Create temporary copies of non-contiguous assumed shape dummy
6977-
arrays in subprogram prologues, and destroy them in subprotram epilogues.
6977+
arrays in subprogram prologues, and destroy them in subprogram epilogues.
69786978
The temporary copy is initialized with values from the original array
69796979
in the prologue, if needed. In the epilogue, the current values
69806980
in the temporary array are copied into the original array, if needed.
@@ -7037,7 +7037,7 @@ defm stack_repack_arrays
70377037
DocBrief<[{Controls whether the array temporaries created under
70387038
**-frepack-arrays** are allocated on the stack or on the heap.
70397039

7040-
By default, the heap is used. Allocations of the polymorphic types
7040+
By default, the heap is used. Allocations of polymorphic types
70417041
are always done on the heap, though this may change in future releases.
70427042
}]>;
70437043

flang/include/flang/Lower/LoweringOptions.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ ENUM_LOWERINGOPT(ReallocateLHS, unsigned, 1, 1)
4848
/// On by default.
4949
ENUM_LOWERINGOPT(InitGlobalZero, unsigned, 1, 1)
5050

51-
/// If true, the arrays of unknown size and array temporaries
52-
/// are requested to be allocated in stack memory.
53-
ENUM_LOWERINGOPT(StackArrays, unsigned, 1, 0)
54-
5551
/// If true, the dummy assumed shape arrays are conditionally
5652
/// packed into contiguous memory.
5753
ENUM_LOWERINGOPT(RepackArrays, unsigned, 1, 0)

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,6 @@ void CompilerInvocation::setLoweringOptions() {
17281728
const Fortran::common::LangOptions &langOptions = getLangOpts();
17291729
loweringOpts.setIntegerWrapAround(langOptions.getSignedOverflowBehavior() ==
17301730
Fortran::common::LangOptions::SOB_Defined);
1731-
loweringOpts.setStackArrays(codegenOpts.StackArrays);
17321731
Fortran::common::MathOptionsBase &mathOpts = loweringOpts.getMathOptions();
17331732
// TODO: when LangOptions are finalized, we can represent
17341733
// the math related options using Fortran::commmon::MathOptionsBase,

flang/test/Driver/frepack-arrays-contiguity.f90

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
! Test forwarding just the forwarding of -frepack-arrays-contiguity options:
1+
! Test forwarding of -frepack-arrays-contiguity options:
22
! RUN: %flang -frepack-arrays-contiguity=whole %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=WHOLECMD %s
33
! RUN: %flang -frepack-arrays-contiguity=innermost %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=INNERMOSTCMD %s
44
! RUN: %flang -frepack-arrays-contiguity=innermost -frepack-arrays-contiguity=whole %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=WHOLECMD %s
55
! RUN: %flang -frepack-arrays-contiguity=whole -frepack-arrays-contiguity=innermost %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=INNERMOSTCMD %s
6+
! RUN: not %flang -frepack-arrays-contiguity= -frepack-arrays-contiguity=innermost %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=ERROR %s
7+
! RUN: not %flang -frepack-arrays-contiguity=whole3 -frepack-arrays-contiguity=innermost %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=ERROR %s
8+
! RUN: not %flang -frepack-arrays-contiguity=innermostg -frepack-arrays-contiguity=innermost %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=ERROR %s
69

710
! Test proper setting of the lowering options:
811
! RUN: %flang_fc1 -frepack-arrays -frepack-arrays-contiguity=whole %s -emit-hlfir -o - | FileCheck --check-prefix=WHOLE %s
@@ -13,6 +16,8 @@
1316
! Default setting is 'innermost':
1417
! RUN: %flang_fc1 -frepack-arrays %s -emit-hlfir -o - | FileCheck --check-prefix=INNERMOST %s
1518

19+
! ERROR: error: unsupported argument '{{.*}}' to option '-frepack-arrays-contiguity='
20+
1621
! WHOLECMD: "-fc1"{{.*}}"-frepack-arrays-contiguity=whole"
1722
! INNERMOSTCMD: "-fc1"{{.*}}"-frepack-arrays-contiguity=innermost"
1823

flang/test/Driver/frepack-arrays.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! Test forwarding just the forwarding of -f[no-]repack-arrays options:
1+
! Test forwarding of -f[no-]repack-arrays options:
22
! RUN: %flang -frepack-arrays %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=REPACKCMD %s
33
! RUN: %flang -fno-repack-arrays %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=NOREPACKCMD %s
44
! RUN: %flang -frepack-arrays -fno-repack-arrays %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=NOREPACKCMD %s

flang/test/Driver/fstack-repack-arrays.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
! Test forwarding just the forwarding of -f[no-]stack-repack-arrays options:
1+
! Test forwarding of -f[no-]stack-repack-arrays options:
22
! RUN: %flang -fstack-repack-arrays %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=STACKCMD %s
33
! RUN: %flang -fno-stack-repack-arrays %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=HEAPCMD %s
44
! RUN: %flang -fstack-repack-arrays -fno-stack-repack-arrays %s -### -fsyntax-only 2>&1 | FileCheck --check-prefix=HEAPCMD %s

flang/tools/bbc/bbc.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,6 @@ static llvm::cl::opt<bool>
251251
"the LHS of the intrinsic assignment"),
252252
llvm::cl::init(true));
253253

254-
// TODO: -fstack-arrays is currently unused, but it should probably be used
255-
// for deciding how arrays/temporaries are allocated during lowering.
256-
static llvm::cl::opt<bool>
257-
stackArrays("fstack-arrays",
258-
llvm::cl::desc("Allocate all arrays of unknown size and "
259-
"temporary arrays in stack memory"),
260-
llvm::cl::init(false));
261-
262254
static llvm::cl::opt<bool> stackRepackArrays(
263255
"fstack-repack-arrays",
264256
llvm::cl::desc("Allocate temporary arrays for -frepack-arrays "
@@ -434,7 +426,6 @@ static llvm::LogicalResult convertFortranSourceToMLIR(
434426
loweringOptions.setIntegerWrapAround(integerWrapAround);
435427
loweringOptions.setInitGlobalZero(initGlobalZero);
436428
loweringOptions.setReallocateLHS(reallocateLHS);
437-
loweringOptions.setStackArrays(stackArrays);
438429
loweringOptions.setStackRepackArrays(stackRepackArrays);
439430
loweringOptions.setRepackArrays(repackArrays);
440431
loweringOptions.setRepackArraysWhole(repackArraysWhole);

0 commit comments

Comments
 (0)