Skip to content

Commit f9e3efe

Browse files
committed
Addressed review comments.
1 parent fb36b91 commit f9e3efe

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
@@ -6968,7 +6968,7 @@ defm repack_arrays
69686968
" non-contiguous assumed shape dummy arrays into "
69696969
"contiguous memory">>,
69706970
DocBrief<[{Create temporary copies of non-contiguous assumed shape dummy
6971-
arrays in subprogram prologues, and destroy them in subprotram epilogues.
6971+
arrays in subprogram prologues, and destroy them in subprogram epilogues.
69726972
The temporary copy is initialized with values from the original array
69736973
in the prologue, if needed. In the epilogue, the current values
69746974
in the temporary array are copied into the original array, if needed.
@@ -7031,7 +7031,7 @@ defm stack_repack_arrays
70317031
DocBrief<[{Controls whether the array temporaries created under
70327032
**-frepack-arrays** are allocated on the stack or on the heap.
70337033

7034-
By default, the heap is used. Allocations of the polymorphic types
7034+
By default, the heap is used. Allocations of polymorphic types
70357035
are always done on the heap, though this may change in future releases.
70367036
}]>;
70377037

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
@@ -1700,7 +1700,6 @@ void CompilerInvocation::setLoweringOptions() {
17001700
const Fortran::common::LangOptions &langOptions = getLangOpts();
17011701
loweringOpts.setIntegerWrapAround(langOptions.getSignedOverflowBehavior() ==
17021702
Fortran::common::LangOptions::SOB_Defined);
1703-
loweringOpts.setStackArrays(codegenOpts.StackArrays);
17041703
Fortran::common::MathOptionsBase &mathOpts = loweringOpts.getMathOptions();
17051704
// TODO: when LangOptions are finalized, we can represent
17061705
// 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
@@ -245,14 +245,6 @@ static llvm::cl::opt<bool>
245245
"the LHS of the intrinsic assignment"),
246246
llvm::cl::init(true));
247247

248-
// TODO: -fstack-arrays is currently unused, but it should probably be used
249-
// for deciding how arrays/temporaries are allocated during lowering.
250-
static llvm::cl::opt<bool>
251-
stackArrays("fstack-arrays",
252-
llvm::cl::desc("Allocate all arrays of unknown size and "
253-
"temporary arrays in stack memory"),
254-
llvm::cl::init(false));
255-
256248
static llvm::cl::opt<bool> stackRepackArrays(
257249
"fstack-repack-arrays",
258250
llvm::cl::desc("Allocate temporary arrays for -frepack-arrays "
@@ -416,7 +408,6 @@ static llvm::LogicalResult convertFortranSourceToMLIR(
416408
loweringOptions.setIntegerWrapAround(integerWrapAround);
417409
loweringOptions.setInitGlobalZero(initGlobalZero);
418410
loweringOptions.setReallocateLHS(reallocateLHS);
419-
loweringOptions.setStackArrays(stackArrays);
420411
loweringOptions.setStackRepackArrays(stackRepackArrays);
421412
loweringOptions.setRepackArrays(repackArrays);
422413
loweringOptions.setRepackArraysWhole(repackArraysWhole);

0 commit comments

Comments
 (0)