Skip to content

Commit cc3e985

Browse files
sebpopmadhur13490
authored andcommitted
rename -floop-fuse / -fexperimental-fuse-loops
1 parent 3b71a3c commit cc3e985

File tree

14 files changed

+42
-43
lines changed

14 files changed

+42
-43
lines changed

clang/include/clang/Basic/CodeGenOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ CODEGENOPT(TimeTrace , 1, 0, Benign) ///< Set when -ftime-trace is enabl
322322
VALUE_CODEGENOPT(TimeTraceGranularity, 32, 500, Benign) ///< Minimum time granularity (in microseconds),
323323
///< traced by time profiler
324324
CODEGENOPT(InterchangeLoops , 1, 0, Benign) ///< Run loop-interchange.
325-
CODEGENOPT(FuseLoops , 1, 0, Benign) ///< Run loop-fuse.
325+
CODEGENOPT(FuseLoops , 1, 0, Benign) ///< Run loop-fusion.
326326
CODEGENOPT(UnrollLoops , 1, 0, Benign) ///< Control whether loops are unrolled.
327327
CODEGENOPT(RerollLoops , 1, 0, Benign) ///< Control whether loops are rerolled.
328328
CODEGENOPT(NoUseJumpTables , 1, 0, Benign) ///< Set when -fno-jump-tables is enabled.

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4253,10 +4253,10 @@ def floop_interchange : Flag<["-"], "floop-interchange">, Group<f_Group>,
42534253
HelpText<"Enable the loop interchange pass">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
42544254
def fno_loop_interchange: Flag<["-"], "fno-loop-interchange">, Group<f_Group>,
42554255
HelpText<"Disable the loop interchange pass">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
4256-
def floop_fuse : Flag<["-"], "floop-fuse">, Group<f_Group>,
4257-
HelpText<"Enable the loop fuse pass">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
4258-
def fno_loop_fuse: Flag<["-"], "fno-loop-fuse">, Group<f_Group>,
4259-
HelpText<"Disable the loop fuse pass">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
4256+
def fexperimental_loop_fusion : Flag<["-"], "fexperimental-loop-fusion">, Group<f_Group>,
4257+
HelpText<"Enable the experimental loop fusion pass">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
4258+
def fno_experimental_loop_fusion: Flag<["-"], "fno-experimental-loop-fusion">, Group<f_Group>,
4259+
HelpText<"Disable the experimental loop fusion pass">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
42604260
def funroll_loops : Flag<["-"], "funroll-loops">, Group<f_Group>,
42614261
HelpText<"Turn on loop unroller">, Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>;
42624262
def fno_unroll_loops : Flag<["-"], "fno-unroll-loops">, Group<f_Group>,

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
897897
PipelineTuningOptions PTO;
898898
PTO.LoopUnrolling = CodeGenOpts.UnrollLoops;
899899
PTO.LoopInterchange = CodeGenOpts.InterchangeLoops;
900-
PTO.LoopFuse = CodeGenOpts.FuseLoops;
900+
PTO.LoopFusion = CodeGenOpts.FuseLoops;
901901
// For historical reasons, loop interleaving is set to mirror setting for loop
902902
// unrolling.
903903
PTO.LoopInterleaving = CodeGenOpts.UnrollLoops;
@@ -1333,7 +1333,7 @@ runThinLTOBackend(CompilerInstance &CI, ModuleSummaryIndex *CombinedIndex,
13331333
Conf.SampleProfile = std::move(SampleProfile);
13341334
Conf.PTO.LoopUnrolling = CGOpts.UnrollLoops;
13351335
Conf.PTO.LoopInterchange = CGOpts.InterchangeLoops;
1336-
Conf.PTO.LoopFuse = CGOpts.FuseLoops;
1336+
Conf.PTO.LoopFusion = CGOpts.FuseLoops;
13371337
// For historical reasons, loop interleaving is set to mirror setting for loop
13381338
// unrolling.
13391339
Conf.PTO.LoopInterleaving = CGOpts.UnrollLoops;

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6869,7 +6869,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
68696869
options::OPT_fno_unroll_loops);
68706870
Args.AddLastArg(CmdArgs, options::OPT_floop_interchange,
68716871
options::OPT_fno_loop_interchange);
6872-
Args.AddLastArg(CmdArgs, options::OPT_floop_fuse, options::OPT_fno_loop_fuse);
6872+
Args.AddLastArg(CmdArgs, options::OPT_fexperimental_loop_fusion,
6873+
options::OPT_fno_experimental_loop_fusion);
68736874

68746875
Args.AddLastArg(CmdArgs, options::OPT_fstrict_flex_arrays_EQ);
68756876

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3265,7 +3265,7 @@ void tools::handleVectorizeSLPArgs(const ArgList &Args,
32653265

32663266
void tools::handleInterchangeLoopsArgs(const ArgList &Args,
32673267
ArgStringList &CmdArgs) {
3268-
// FIXME: Instead of relying on shouldEnableVectorizerAtOLevel, we may want to
3268+
// FIXME: instead of relying on shouldEnableVectorizerAtOLevel, we may want to
32693269
// implement a separate function to infer loop interchange from opt level.
32703270
// For now, enable loop-interchange at the same opt levels as loop-vectorize.
32713271
bool EnableInterchange = shouldEnableVectorizerAtOLevel(Args, false);

clang/lib/Driver/ToolChains/Flang.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ void Flang::addCodegenOptions(const ArgList &Args,
151151
!stackArrays->getOption().matches(options::OPT_fno_stack_arrays))
152152
CmdArgs.push_back("-fstack-arrays");
153153

154-
Args.AddLastArg(CmdArgs, options::OPT_floop_fuse, options::OPT_fno_loop_fuse);
154+
Args.AddLastArg(CmdArgs, options::OPT_fexperimental_loop_fusion,
155+
options::OPT_fno_experimental_loop_fusion);
155156

156157
handleInterchangeLoopsArgs(Args, CmdArgs);
157158
handleVectorizeLoopsArgs(Args, CmdArgs);

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,9 +1672,9 @@ void CompilerInvocationBase::GenerateCodeGenArgs(const CodeGenOptions &Opts,
16721672
GenerateArg(Consumer, OPT_fno_loop_interchange);
16731673

16741674
if (Opts.FuseLoops)
1675-
GenerateArg(Consumer, OPT_floop_fuse);
1675+
GenerateArg(Consumer, OPT_fexperimental_loop_fusion);
16761676
else
1677-
GenerateArg(Consumer, OPT_fno_loop_fuse);
1677+
GenerateArg(Consumer, OPT_fno_experimental_loop_fusion);
16781678

16791679
if (!Opts.BinutilsVersion.empty())
16801680
GenerateArg(Consumer, OPT_fbinutils_version_EQ, Opts.BinutilsVersion);
@@ -1996,7 +1996,8 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
19961996
(Opts.OptimizationLevel > 1));
19971997
Opts.InterchangeLoops =
19981998
Args.hasFlag(OPT_floop_interchange, OPT_fno_loop_interchange, false);
1999-
Opts.FuseLoops = Args.hasFlag(OPT_floop_fuse, OPT_fno_loop_fuse, false);
1999+
Opts.FuseLoops = Args.hasFlag(OPT_fexperimental_loop_fusion,
2000+
OPT_fno_experimental_loop_fusion, false);
20002001
Opts.BinutilsVersion =
20012002
std::string(Args.getLastArgValue(OPT_fbinutils_version_EQ));
20022003

clang/test/Driver/clang_f_opts.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
// CHECK-INTERCHANGE-LOOPS: "-floop-interchange"
5353
// CHECK-NO-INTERCHANGE-LOOPS: "-fno-loop-interchange"
5454

55-
// RUN: %clang -### -S -floop-fuse %s 2>&1 | FileCheck -check-prefix=CHECK-FUSE-LOOPS %s
56-
// RUN: %clang -### -S -fno-loop-fuse %s 2>&1 | FileCheck -check-prefix=CHECK-NO-FUSE-LOOPS %s
57-
// RUN: %clang -### -S -fno-loop-fuse -floop-fuse %s 2>&1 | FileCheck -check-prefix=CHECK-FUSE-LOOPS %s
58-
// RUN: %clang -### -S -floop-fuse -fno-loop-fuse %s 2>&1 | FileCheck -check-prefix=CHECK-NO-FUSE-LOOPS %s
59-
// CHECK-FUSE-LOOPS: "-floop-fuse"
60-
// CHECK-NO-FUSE-LOOPS: "-fno-loop-fuse"
55+
// RUN: %clang -### -S -fexperimental-loop-fusion %s 2>&1 | FileCheck -check-prefix=CHECK-FUSE-LOOPS %s
56+
// RUN: %clang -### -S -fno-experimental-loop-fusion %s 2>&1 | FileCheck -check-prefix=CHECK-NO-FUSE-LOOPS %s
57+
// RUN: %clang -### -S -fno-experimental-loop-fusion -fexperimental-loop-fusion %s 2>&1 | FileCheck -check-prefix=CHECK-FUSE-LOOPS %s
58+
// RUN: %clang -### -S -fexperimental-loop-fusion -fno-experimental-loop-fusion %s 2>&1 | FileCheck -check-prefix=CHECK-NO-FUSE-LOOPS %s
59+
// CHECK-FUSE-LOOPS: "-fexperimental-loop-fusion"
60+
// CHECK-NO-FUSE-LOOPS: "-fno-experimental-loop-fusion"
6161

6262
// RUN: %clang -### -S -fprofile-sample-accurate %s 2>&1 | FileCheck -check-prefix=CHECK-PROFILE-SAMPLE-ACCURATE %s
6363
// CHECK-PROFILE-SAMPLE-ACCURATE: "-fprofile-sample-accurate"

flang/docs/ReleaseNotes.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ page](https://llvm.org/releases/).
3232

3333
## New Compiler Flags
3434

35-
* -floop-interchange is now recognized by flang.
36-
* -floop-interchange is enabled by default at -O2 and above.
37-
* -floop-fuse is now recognized by flang.
35+
* -fexperimental-loop-fusion is now recognized by flang.
3836

3937
## Windows Support
4038

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
275275
if (args.getLastArg(clang::driver::options::OPT_floop_interchange))
276276
opts.InterchangeLoops = 1;
277277

278-
if (args.getLastArg(clang::driver::options::OPT_floop_fuse))
278+
if (args.getLastArg(clang::driver::options::OPT_fexperimental_loop_fusion))
279279
opts.FuseLoops = 1;
280280

281281
if (args.getLastArg(clang::driver::options::OPT_vectorize_loops))

0 commit comments

Comments
 (0)