Skip to content

Commit 8d6b451

Browse files
committed
[LegacyPM] Remove legacy LoopRotate pass
1 parent c92dfef commit 8d6b451

File tree

6 files changed

+0
-86
lines changed

6 files changed

+0
-86
lines changed

llvm/include/llvm/InitializePasses.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ void initializeLoopDataPrefetchLegacyPassPass(PassRegistry&);
164164
void initializeLoopExtractorLegacyPassPass(PassRegistry &);
165165
void initializeLoopInfoWrapperPassPass(PassRegistry&);
166166
void initializeLoopPassPass(PassRegistry&);
167-
void initializeLoopRotateLegacyPassPass(PassRegistry&);
168167
void initializeLoopSimplifyPass(PassRegistry&);
169168
void initializeLoopStrengthReducePass(PassRegistry&);
170169
void initializeLoopUnrollPass(PassRegistry&);

llvm/include/llvm/LinkAllPasses.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ namespace {
8989
(void) llvm::createLoopSimplifyPass();
9090
(void) llvm::createLoopStrengthReducePass();
9191
(void) llvm::createLoopUnrollPass();
92-
(void) llvm::createLoopRotatePass();
9392
(void) llvm::createLowerConstantIntrinsicsPass();
9493
(void) llvm::createLowerGlobalDtorsLegacyPass();
9594
(void) llvm::createLowerInvokePass();

llvm/include/llvm/Transforms/Scalar.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ Pass *createLoopUnrollPass(int OptLevel = 2, bool OnlyWhenForced = false,
6161
int Runtime = -1, int UpperBound = -1,
6262
int AllowPeeling = -1);
6363

64-
//===----------------------------------------------------------------------===//
65-
//
66-
// LoopRotate - This pass is a simple loop rotating pass.
67-
//
68-
Pass *createLoopRotatePass(int MaxHeaderSize = -1, bool PrepareForLTO = false);
69-
7064
//===----------------------------------------------------------------------===//
7165
//
7266
// Reassociate - This pass reassociates commutative expressions in an order that

llvm/lib/Transforms/Scalar/LoopRotation.cpp

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -89,79 +89,3 @@ PreservedAnalyses LoopRotatePass::run(Loop &L, LoopAnalysisManager &AM,
8989
PA.preserve<MemorySSAAnalysis>();
9090
return PA;
9191
}
92-
93-
namespace {
94-
95-
class LoopRotateLegacyPass : public LoopPass {
96-
unsigned MaxHeaderSize;
97-
bool PrepareForLTO;
98-
99-
public:
100-
static char ID; // Pass ID, replacement for typeid
101-
LoopRotateLegacyPass(int SpecifiedMaxHeaderSize = -1,
102-
bool PrepareForLTO = false)
103-
: LoopPass(ID), PrepareForLTO(PrepareForLTO) {
104-
initializeLoopRotateLegacyPassPass(*PassRegistry::getPassRegistry());
105-
if (SpecifiedMaxHeaderSize == -1)
106-
MaxHeaderSize = DefaultRotationThreshold;
107-
else
108-
MaxHeaderSize = unsigned(SpecifiedMaxHeaderSize);
109-
}
110-
111-
// LCSSA form makes instruction renaming easier.
112-
void getAnalysisUsage(AnalysisUsage &AU) const override {
113-
AU.addRequired<AssumptionCacheTracker>();
114-
AU.addRequired<TargetTransformInfoWrapperPass>();
115-
AU.addPreserved<MemorySSAWrapperPass>();
116-
getLoopAnalysisUsage(AU);
117-
118-
// Lazy BFI and BPI are marked as preserved here so LoopRotate
119-
// can remain part of the same loop pass manager as LICM.
120-
AU.addPreserved<LazyBlockFrequencyInfoPass>();
121-
AU.addPreserved<LazyBranchProbabilityInfoPass>();
122-
}
123-
124-
bool runOnLoop(Loop *L, LPPassManager &LPM) override {
125-
if (skipLoop(L))
126-
return false;
127-
Function &F = *L->getHeader()->getParent();
128-
129-
auto *LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
130-
const auto *TTI = &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
131-
auto *AC = &getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
132-
auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
133-
auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE();
134-
const SimplifyQuery SQ = getBestSimplifyQuery(*this, F);
135-
std::optional<MemorySSAUpdater> MSSAU;
136-
// Not requiring MemorySSA and getting it only if available will split
137-
// the loop pass pipeline when LoopRotate is being run first.
138-
auto *MSSAA = getAnalysisIfAvailable<MemorySSAWrapperPass>();
139-
if (MSSAA)
140-
MSSAU = MemorySSAUpdater(&MSSAA->getMSSA());
141-
// Vectorization requires loop-rotation. Use default threshold for loops the
142-
// user explicitly marked for vectorization, even when header duplication is
143-
// disabled.
144-
int Threshold = hasVectorizeTransformation(L) == TM_ForcedByUser
145-
? DefaultRotationThreshold
146-
: MaxHeaderSize;
147-
148-
return LoopRotation(L, LI, TTI, AC, &DT, &SE, MSSAU ? &*MSSAU : nullptr, SQ,
149-
false, Threshold, false,
150-
PrepareForLTO || PrepareForLTOOption);
151-
}
152-
};
153-
} // end namespace
154-
155-
char LoopRotateLegacyPass::ID = 0;
156-
INITIALIZE_PASS_BEGIN(LoopRotateLegacyPass, "loop-rotate", "Rotate Loops",
157-
false, false)
158-
INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
159-
INITIALIZE_PASS_DEPENDENCY(LoopPass)
160-
INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass)
161-
INITIALIZE_PASS_DEPENDENCY(MemorySSAWrapperPass)
162-
INITIALIZE_PASS_END(LoopRotateLegacyPass, "loop-rotate", "Rotate Loops", false,
163-
false)
164-
165-
Pass *llvm::createLoopRotatePass(int MaxHeaderSize, bool PrepareForLTO) {
166-
return new LoopRotateLegacyPass(MaxHeaderSize, PrepareForLTO);
167-
}

llvm/lib/Transforms/Scalar/Scalar.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
2929
initializeInstSimplifyLegacyPassPass(Registry);
3030
initializeLegacyLICMPassPass(Registry);
3131
initializeLoopDataPrefetchLegacyPassPass(Registry);
32-
initializeLoopRotateLegacyPassPass(Registry);
3332
initializeLoopStrengthReducePass(Registry);
3433
initializeLoopUnrollPass(Registry);
3534
initializeLowerAtomicLegacyPassPass(Registry);

polly/lib/Transform/Canonicalization.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ void polly::registerCanonicalicationPasses(llvm::legacy::PassManagerBase &PM) {
4848
PM.add(llvm::createTailCallEliminationPass());
4949
PM.add(llvm::createCFGSimplificationPass());
5050
PM.add(llvm::createReassociatePass());
51-
PM.add(llvm::createLoopRotatePass());
5251
if (PollyInliner) {
5352
PM.add(llvm::createPromoteMemoryToRegisterPass());
5453
PM.add(llvm::createCFGSimplificationPass());

0 commit comments

Comments
 (0)