Skip to content

Commit 7ec3860

Browse files
sebpopmadhur13490
authored andcommitted
rename -floop-fuse / -fexperimental-fuse-loops
1 parent e1bd099 commit 7ec3860

File tree

5 files changed

+19
-21
lines changed

5 files changed

+19
-21
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

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

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

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-fuse-loops %s 2>&1 | FileCheck -check-prefix=CHECK-FUSE-LOOPS %s
56+
// RUN: %clang -### -S -fno-experimental-fuse-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-FUSE-LOOPS %s
57+
// RUN: %clang -### -S -fno-experimental-fuse-loops -fexperimental-fuse-loops %s 2>&1 | FileCheck -check-prefix=CHECK-FUSE-LOOPS %s
58+
// RUN: %clang -### -S -fexperimental-fuse-loops -fno-experimental-fuse-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-FUSE-LOOPS %s
59+
// CHECK-FUSE-LOOPS: "-fexperimental-fuse-loops"
60+
// CHECK-NO-FUSE-LOOPS: "-fno-experimental-fuse-loops"
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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ page](https://llvm.org/releases/).
3434

3535
* -floop-interchange is now recognized by flang.
3636
* -floop-interchange is enabled by default at -O2 and above.
37-
* -floop-fuse is now recognized by flang.
3837

3938
## Windows Support
4039

flang/test/Driver/loop-fuse.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
! RUN: %flang -### -S -floop-fuse %s 2>&1 | FileCheck -check-prefix=CHECK-LOOP-FUSE %s
2-
! RUN: %flang -### -S -fno-loop-fuse %s 2>&1 | FileCheck -check-prefix=CHECK-NO-LOOP-FUSE %s
1+
! RUN: %flang -### -S -fexperimental-fuse-loops %s 2>&1 | FileCheck -check-prefix=CHECK-LOOP-FUSE %s
2+
! RUN: %flang -### -S -fno-experimental-fuse-loops %s 2>&1 | FileCheck -check-prefix=CHECK-NO-LOOP-FUSE %s
33
! RUN: %flang -### -S -O0 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-LOOP-FUSE %s
44
! RUN: %flang -### -S -O1 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-LOOP-FUSE %s
55
! RUN: %flang -### -S -O2 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-LOOP-FUSE %s
66
! RUN: %flang -### -S -O3 %s 2>&1 | FileCheck -check-prefix=CHECK-NO-LOOP-FUSE %s
77
! RUN: %flang -### -S -Os %s 2>&1 | FileCheck -check-prefix=CHECK-NO-LOOP-FUSE %s
88
! RUN: %flang -### -S -Oz %s 2>&1 | FileCheck -check-prefix=CHECK-NO-LOOP-FUSE %s
9-
! CHECK-LOOP-FUSE: "-floop-fuse"
10-
! CHECK-NO-LOOP-FUSE-NOT: "-floop-fuse"
11-
! RUN: %flang_fc1 -emit-llvm -O2 -floop-fuse -mllvm -print-pipeline-passes -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-LOOP-FUSE-PASS %s
12-
! RUN: %flang_fc1 -emit-llvm -O2 -fno-loop-fuse -mllvm -print-pipeline-passes -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-NO-LOOP-FUSE-PASS %s
9+
! CHECK-LOOP-FUSE: "-fexperimental-fuse-loops"
10+
! CHECK-NO-LOOP-FUSE-NOT: "-fexperimental-fuse-loops"
11+
! RUN: %flang_fc1 -emit-llvm -O2 -fexperimental-fuse-loops -mllvm -print-pipeline-passes -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-LOOP-FUSE-PASS %s
12+
! RUN: %flang_fc1 -emit-llvm -O2 -fno-experimental-fuse-loops -mllvm -print-pipeline-passes -o /dev/null %s 2>&1 | FileCheck -check-prefix=CHECK-NO-LOOP-FUSE-PASS %s
1313
! CHECK-LOOP-FUSE-PASS: loop-fusion
1414
! CHECK-NO-LOOP-FUSE-PASS-NOT: loop-fusion
1515

llvm/lib/Passes/PassBuilderPipelines.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,6 @@ PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level,
520520

521521
invokeLoopOptimizerEndEPCallbacks(LPM2, Level);
522522

523-
if (PTO.LoopFuse)
524-
FPM.addPass(LoopFusePass());
525-
526523
FPM.addPass(createFunctionToLoopPassAdaptor(std::move(LPM1),
527524
/*UseMemorySSA=*/true,
528525
/*UseBlockFrequencyInfo=*/true));
@@ -647,6 +644,9 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
647644
if (EnableConstraintElimination)
648645
FPM.addPass(ConstraintEliminationPass());
649646

647+
if (EnableLoopFuse)
648+
FPM.addPass(LoopFusePass());
649+
650650
// Add the primary loop simplification pipeline.
651651
// FIXME: Currently this is split into two loop pass pipelines because we run
652652
// some function passes in between them. These can and should be removed
@@ -712,9 +712,6 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
712712

713713
invokeLoopOptimizerEndEPCallbacks(LPM2, Level);
714714

715-
if (PTO.LoopFuse)
716-
FPM.addPass(LoopFusePass());
717-
718715
FPM.addPass(createFunctionToLoopPassAdaptor(std::move(LPM1),
719716
/*UseMemorySSA=*/true,
720717
/*UseBlockFrequencyInfo=*/true));
@@ -1452,6 +1449,7 @@ void PassBuilder::addVectorPasses(OptimizationLevel Level,
14521449

14531450
ModulePassManager
14541451
PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
1452+
14551453
ThinOrFullLTOPhase LTOPhase) {
14561454
const bool LTOPreLink = isLTOPreLink(LTOPhase);
14571455
ModulePassManager MPM;
@@ -2127,6 +2125,7 @@ PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
21272125
LPM.addPass(LoopFlattenPass());
21282126
LPM.addPass(IndVarSimplifyPass());
21292127
LPM.addPass(LoopDeletionPass());
2128+
// FIXME: Add loop interchange.
21302129

21312130
// Unroll small loops and perform peeling.
21322131
LPM.addPass(LoopFullUnrollPass(Level.getSpeedupLevel(),
@@ -2366,4 +2365,4 @@ AAManager PassBuilder::buildDefaultAAPipeline() {
23662365
bool PassBuilder::isInstrumentedPGOUse() const {
23672366
return (PGOOpt && PGOOpt->Action == PGOOptions::IRUse) ||
23682367
!UseCtxProfile.empty();
2369-
}
2368+
}

0 commit comments

Comments
 (0)