Skip to content

Commit cee313d

Browse files
committed
Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
1 parent c3d6a92 commit cee313d

File tree

4,868 files changed

+575521
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,868 files changed

+575521
-0
lines changed

llvm/include/llvm/InitializePasses.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ void initializeLoopDeletionLegacyPassPass(PassRegistry&);
219219
void initializeLoopDistributeLegacyPass(PassRegistry&);
220220
void initializeLoopExtractorPass(PassRegistry&);
221221
void initializeLoopGuardWideningLegacyPassPass(PassRegistry&);
222+
void initializeLoopFuseLegacyPass(PassRegistry&);
222223
void initializeLoopIdiomRecognizeLegacyPassPass(PassRegistry&);
223224
void initializeLoopInfoWrapperPassPass(PassRegistry&);
224225
void initializeLoopInstSimplifyLegacyPassPass(PassRegistry&);

llvm/include/llvm/Transforms/Scalar.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,12 @@ FunctionPass *createNaryReassociatePass();
458458
//
459459
FunctionPass *createLoopDistributePass();
460460

461+
//===----------------------------------------------------------------------===//
462+
//
463+
// LoopFuse - Fuse loops.
464+
//
465+
FunctionPass *createLoopFusePass();
466+
461467
//===----------------------------------------------------------------------===//
462468
//
463469
// LoopLoadElimination - Perform loop-aware load elimination.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//===- LoopFuse.h - Loop Fusion Pass ----------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
///
9+
/// \file
10+
/// This file implements the Loop Fusion pass.
11+
///
12+
//===----------------------------------------------------------------------===//
13+
14+
#ifndef LLVM_TRANSFORMS_SCALAR_LOOPFUSE_H
15+
#define LLVM_TRANSFORMS_SCALAR_LOOPFUSE_H
16+
17+
#include "llvm/IR/PassManager.h"
18+
19+
namespace llvm {
20+
21+
class Function;
22+
23+
class LoopFusePass : public PassInfoMixin<LoopFusePass> {
24+
public:
25+
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
26+
};
27+
28+
} // end namespace llvm
29+
30+
#endif // LLVM_TRANSFORMS_SCALAR_LOOPFUSE_H

llvm/lib/Passes/PassBuilder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
#include "llvm/Transforms/Scalar/LoopDataPrefetch.h"
123123
#include "llvm/Transforms/Scalar/LoopDeletion.h"
124124
#include "llvm/Transforms/Scalar/LoopDistribute.h"
125+
#include "llvm/Transforms/Scalar/LoopFuse.h"
125126
#include "llvm/Transforms/Scalar/LoopIdiomRecognize.h"
126127
#include "llvm/Transforms/Scalar/LoopInstSimplify.h"
127128
#include "llvm/Transforms/Scalar/LoopLoadElimination.h"

llvm/lib/Passes/PassRegistry.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ FUNCTION_PASS("partially-inline-libcalls", PartiallyInlineLibCallsPass())
197197
FUNCTION_PASS("lcssa", LCSSAPass())
198198
FUNCTION_PASS("loop-data-prefetch", LoopDataPrefetchPass())
199199
FUNCTION_PASS("loop-load-elim", LoopLoadEliminationPass())
200+
FUNCTION_PASS("loop-fuse", LoopFusePass())
200201
FUNCTION_PASS("loop-distribute", LoopDistributePass())
201202
FUNCTION_PASS("loop-vectorize", LoopVectorizePass())
202203
FUNCTION_PASS("pgo-memop-opt", PGOMemOPSizeOpt())

llvm/lib/Transforms/Scalar/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ add_llvm_library(LLVMScalarOpts
2828
LoopDeletion.cpp
2929
LoopDataPrefetch.cpp
3030
LoopDistribute.cpp
31+
LoopFuse.cpp
3132
LoopIdiomRecognize.cpp
3233
LoopInstSimplify.cpp
3334
LoopInterchange.cpp

0 commit comments

Comments
 (0)