Skip to content

Commit 0b911a3

Browse files
committed
[passes] Remove the legacy PM version of IRCE
Differential Revision: https://reviews.llvm.org/D148338
1 parent b74e89c commit 0b911a3

File tree

5 files changed

+0
-81
lines changed

5 files changed

+0
-81
lines changed

llvm/include/llvm/InitializePasses.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ void initializeGuardWideningLegacyPassPass(PassRegistry&);
147147
void initializeHardwareLoopsLegacyPass(PassRegistry&);
148148
void initializeMIRProfileLoaderPassPass(PassRegistry &);
149149
void initializeIPSCCPLegacyPassPass(PassRegistry&);
150-
void initializeIRCELegacyPassPass(PassRegistry&);
151150
void initializeIRSimilarityIdentifierWrapperPassPass(PassRegistry&);
152151
void initializeIRTranslatorPass(PassRegistry&);
153152
void initializeIVUsersWrapperPassPass(PassRegistry&);

llvm/include/llvm/LinkAllPasses.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ namespace {
9090
(void) llvm::createGlobalsAAWrapperPass();
9191
(void) llvm::createGuardWideningPass();
9292
(void) llvm::createLoopGuardWideningPass();
93-
(void) llvm::createInductiveRangeCheckEliminationPass();
9493
(void) llvm::createInstSimplifyLegacyPass();
9594
(void) llvm::createInstructionCombiningPass();
9695
(void) llvm::createJMCInstrumenterPass();

llvm/include/llvm/Transforms/Scalar.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ Pass *createLoopGuardWideningPass();
7272
//
7373
FunctionPass *createSROAPass(bool PreserveCFG = true);
7474

75-
//===----------------------------------------------------------------------===//
76-
//
77-
// InductiveRangeCheckElimination - Transform loops to elide range checks on
78-
// linear functions of the induction variable.
79-
//
80-
Pass *createInductiveRangeCheckEliminationPass();
81-
8275
//===----------------------------------------------------------------------===//
8376
//
8477
// LICM - This pass is a loop invariant code motion and memory promotion pass.

llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@
7272
#include "llvm/IR/Use.h"
7373
#include "llvm/IR/User.h"
7474
#include "llvm/IR/Value.h"
75-
#include "llvm/InitializePasses.h"
76-
#include "llvm/Pass.h"
7775
#include "llvm/Support/BranchProbability.h"
7876
#include "llvm/Support/Casting.h"
7977
#include "llvm/Support/CommandLine.h"
@@ -249,40 +247,8 @@ class InductiveRangeCheckElimination {
249247
bool run(Loop *L, function_ref<void(Loop *, bool)> LPMAddNewLoop);
250248
};
251249

252-
class IRCELegacyPass : public FunctionPass {
253-
public:
254-
static char ID;
255-
256-
IRCELegacyPass() : FunctionPass(ID) {
257-
initializeIRCELegacyPassPass(*PassRegistry::getPassRegistry());
258-
}
259-
260-
void getAnalysisUsage(AnalysisUsage &AU) const override {
261-
AU.addRequired<BranchProbabilityInfoWrapperPass>();
262-
AU.addRequired<DominatorTreeWrapperPass>();
263-
AU.addPreserved<DominatorTreeWrapperPass>();
264-
AU.addRequired<LoopInfoWrapperPass>();
265-
AU.addPreserved<LoopInfoWrapperPass>();
266-
AU.addRequired<ScalarEvolutionWrapperPass>();
267-
AU.addPreserved<ScalarEvolutionWrapperPass>();
268-
}
269-
270-
bool runOnFunction(Function &F) override;
271-
};
272-
273250
} // end anonymous namespace
274251

275-
char IRCELegacyPass::ID = 0;
276-
277-
INITIALIZE_PASS_BEGIN(IRCELegacyPass, "irce",
278-
"Inductive range check elimination", false, false)
279-
INITIALIZE_PASS_DEPENDENCY(BranchProbabilityInfoWrapperPass)
280-
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
281-
INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
282-
INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass)
283-
INITIALIZE_PASS_END(IRCELegacyPass, "irce", "Inductive range check elimination",
284-
false, false)
285-
286252
/// Parse a single ICmp instruction, `ICI`, into a range check. If `ICI` cannot
287253
/// be interpreted as a range check, return false and set `Index` and `End`
288254
/// to `nullptr`. Otherwise set `Index` to the SCEV being range checked, and
@@ -1826,39 +1792,6 @@ PreservedAnalyses IRCEPass::run(Function &F, FunctionAnalysisManager &AM) {
18261792
return getLoopPassPreservedAnalyses();
18271793
}
18281794

1829-
bool IRCELegacyPass::runOnFunction(Function &F) {
1830-
if (skipFunction(F))
1831-
return false;
1832-
1833-
ScalarEvolution &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE();
1834-
BranchProbabilityInfo &BPI =
1835-
getAnalysis<BranchProbabilityInfoWrapperPass>().getBPI();
1836-
auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
1837-
auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
1838-
InductiveRangeCheckElimination IRCE(SE, &BPI, DT, LI);
1839-
1840-
bool Changed = false;
1841-
1842-
for (const auto &L : LI) {
1843-
Changed |= simplifyLoop(L, &DT, &LI, &SE, nullptr, nullptr,
1844-
/*PreserveLCSSA=*/false);
1845-
Changed |= formLCSSARecursively(*L, DT, &LI, &SE);
1846-
}
1847-
1848-
SmallPriorityWorklist<Loop *, 4> Worklist;
1849-
appendLoopsToWorklist(LI, Worklist);
1850-
auto LPMAddNewLoop = [&](Loop *NL, bool IsSubloop) {
1851-
if (!IsSubloop)
1852-
appendLoopsToWorklist(*NL, Worklist);
1853-
};
1854-
1855-
while (!Worklist.empty()) {
1856-
Loop *L = Worklist.pop_back_val();
1857-
Changed |= IRCE.run(L, LPMAddNewLoop);
1858-
}
1859-
return Changed;
1860-
}
1861-
18621795
bool
18631796
InductiveRangeCheckElimination::isProfitableToTransform(const Loop &L,
18641797
LoopStructure &LS) {
@@ -1998,7 +1931,3 @@ bool InductiveRangeCheckElimination::run(
19981931

19991932
return Changed;
20001933
}
2001-
2002-
Pass *llvm::createInductiveRangeCheckEliminationPass() {
2003-
return new IRCELegacyPass();
2004-
}

llvm/lib/Transforms/Scalar/Scalar.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
3838
initializeEarlyCSEMemSSALegacyPassPass(Registry);
3939
initializeMakeGuardsExplicitLegacyPassPass(Registry);
4040
initializeFlattenCFGLegacyPassPass(Registry);
41-
initializeIRCELegacyPassPass(Registry);
4241
initializeInferAddressSpacesPass(Registry);
4342
initializeInstSimplifyLegacyPassPass(Registry);
4443
initializeLegacyLICMPassPass(Registry);

0 commit comments

Comments
 (0)