Skip to content

Commit b677d07

Browse files
committed
[IPSCCP] Remove legacy pass
This is part of the optimization pipeline, of which the legacy pass manager version is deprecated.
1 parent 36606cf commit b677d07

File tree

10 files changed

+1
-104
lines changed

10 files changed

+1
-104
lines changed

llvm/bindings/ocaml/transforms/ipo/ipo_ocaml.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,3 @@ value llvm_add_global_dce(LLVMPassManagerRef PM) {
4848
LLVMAddGlobalDCEPass(PM);
4949
return Val_unit;
5050
}
51-
52-
/* [`Module] Llvm.PassManager.t -> unit */
53-
value llvm_add_ipsccp(LLVMPassManagerRef PM) {
54-
LLVMAddIPSCCPPass(PM);
55-
return Val_unit;
56-
}
57-

llvm/bindings/ocaml/transforms/ipo/llvm_ipo.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,3 @@ external add_always_inliner
2121
external add_global_dce
2222
: [ `Module ] Llvm.PassManager.t -> unit
2323
= "llvm_add_global_dce"
24-
external add_ipsccp
25-
: [ `Module ] Llvm.PassManager.t -> unit
26-
= "llvm_add_ipsccp"

llvm/bindings/ocaml/transforms/ipo/llvm_ipo.mli

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,4 @@ external add_always_inliner
3535
external add_global_dce
3636
: [ `Module ] Llvm.PassManager.t -> unit
3737
= "llvm_add_global_dce"
38-
39-
(** See the [llvm::createIPSCCPPass] function. *)
40-
external add_ipsccp
41-
: [ `Module ] Llvm.PassManager.t -> unit
42-
= "llvm_add_ipsccp"
38+

llvm/include/llvm-c/Transforms/IPO.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ void LLVMAddAlwaysInlinerPass(LLVMPassManagerRef PM);
4242
/** See llvm::createGlobalDCEPass function. */
4343
void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM);
4444

45-
/** See llvm::createIPSCCPPass function. */
46-
void LLVMAddIPSCCPPass(LLVMPassManagerRef PM);
47-
4845
/**
4946
* @}
5047
*/

llvm/include/llvm/LinkAllPasses.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ namespace {
9797
(void) llvm::createGlobalsAAWrapperPass();
9898
(void) llvm::createGuardWideningPass();
9999
(void) llvm::createLoopGuardWideningPass();
100-
(void) llvm::createIPSCCPPass();
101100
(void) llvm::createInductiveRangeCheckEliminationPass();
102101
(void) llvm::createIndVarSimplifyPass();
103102
(void) llvm::createInstSimplifyLegacyPass();

llvm/include/llvm/Transforms/IPO.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@ ModulePass *createDeadArgEliminationPass();
7676
/// bugpoint.
7777
ModulePass *createDeadArgHackingPass();
7878

79-
//===----------------------------------------------------------------------===//
80-
/// createIPSCCPPass - This pass propagates constants from call sites into the
81-
/// bodies of functions, and keeps track of whether basic blocks are executable
82-
/// in the process.
83-
///
84-
ModulePass *createIPSCCPPass();
85-
8679
//===----------------------------------------------------------------------===//
8780
//
8881
/// createLoopExtractorPass - This pass extracts all natural loops from the

llvm/lib/Transforms/IPO/IPO.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ void llvm::initializeIPO(PassRegistry &Registry) {
3636
initializeAttributorLegacyPassPass(Registry);
3737
initializeAttributorCGSCCLegacyPassPass(Registry);
3838
initializePostOrderFunctionAttrsLegacyPassPass(Registry);
39-
initializeIPSCCPLegacyPassPass(Registry);
4039
initializeBarrierNoopPass(Registry);
4140
initializeEliminateAvailableExternallyLegacyPassPass(Registry);
4241
}
@@ -64,7 +63,3 @@ void LLVMAddAlwaysInlinerPass(LLVMPassManagerRef PM) {
6463
void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM) {
6564
unwrap(PM)->add(createGlobalDCEPass());
6665
}
67-
68-
void LLVMAddIPSCCPPass(LLVMPassManagerRef PM) {
69-
unwrap(PM)->add(createIPSCCPPass());
70-
}

llvm/lib/Transforms/IPO/PassManagerBuilder.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,6 @@ void PassManagerBuilder::populateModulePassManager(
310310
if (OptLevel > 2)
311311
MPM.add(createCallSiteSplittingPass());
312312

313-
MPM.add(createIPSCCPPass()); // IP SCCP
314-
315313
// Promote any localized global vars.
316314
MPM.add(createPromoteMemoryToRegisterPass());
317315

llvm/lib/Transforms/IPO/SCCP.cpp

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -407,73 +407,3 @@ PreservedAnalyses IPSCCPPass::run(Module &M, ModuleAnalysisManager &AM) {
407407
PA.preserve<FunctionAnalysisManagerModuleProxy>();
408408
return PA;
409409
}
410-
411-
namespace {
412-
413-
//===--------------------------------------------------------------------===//
414-
//
415-
/// IPSCCP Class - This class implements interprocedural Sparse Conditional
416-
/// Constant Propagation.
417-
///
418-
class IPSCCPLegacyPass : public ModulePass {
419-
public:
420-
static char ID;
421-
422-
IPSCCPLegacyPass() : ModulePass(ID) {
423-
initializeIPSCCPLegacyPassPass(*PassRegistry::getPassRegistry());
424-
}
425-
426-
bool runOnModule(Module &M) override {
427-
if (skipModule(M))
428-
return false;
429-
const DataLayout &DL = M.getDataLayout();
430-
auto GetTLI = [this](Function &F) -> const TargetLibraryInfo & {
431-
return this->getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F);
432-
};
433-
auto GetTTI = [this](Function &F) -> TargetTransformInfo & {
434-
return this->getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
435-
};
436-
auto GetAC = [this](Function &F) -> AssumptionCache & {
437-
return this->getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
438-
};
439-
auto getAnalysis = [this](Function &F) -> AnalysisResultsForFn {
440-
DominatorTree &DT =
441-
this->getAnalysis<DominatorTreeWrapperPass>(F).getDomTree();
442-
return {
443-
std::make_unique<PredicateInfo>(
444-
F, DT,
445-
this->getAnalysis<AssumptionCacheTracker>().getAssumptionCache(
446-
F)),
447-
nullptr, // We cannot preserve the LI, DT or PDT with the legacy pass
448-
nullptr, // manager, so set them to nullptr.
449-
nullptr};
450-
};
451-
452-
return runIPSCCP(M, DL, nullptr, GetTLI, GetTTI, GetAC, getAnalysis, false);
453-
}
454-
455-
void getAnalysisUsage(AnalysisUsage &AU) const override {
456-
AU.addRequired<AssumptionCacheTracker>();
457-
AU.addRequired<DominatorTreeWrapperPass>();
458-
AU.addRequired<TargetLibraryInfoWrapperPass>();
459-
AU.addRequired<TargetTransformInfoWrapperPass>();
460-
}
461-
};
462-
463-
} // end anonymous namespace
464-
465-
char IPSCCPLegacyPass::ID = 0;
466-
467-
INITIALIZE_PASS_BEGIN(IPSCCPLegacyPass, "ipsccp",
468-
"Interprocedural Sparse Conditional Constant Propagation",
469-
false, false)
470-
INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
471-
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
472-
INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
473-
INITIALIZE_PASS_END(IPSCCPLegacyPass, "ipsccp",
474-
"Interprocedural Sparse Conditional Constant Propagation",
475-
false, false)
476-
477-
// createIPSCCPPass - This is the public interface to this file.
478-
ModulePass *llvm::createIPSCCPPass() { return new IPSCCPLegacyPass(); }
479-

llvm/test/Bindings/OCaml/ipo.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ let test_transforms () =
5252
++ add_function_attrs
5353
++ add_always_inliner
5454
++ add_global_dce
55-
++ add_ipsccp
5655
++ PassManager.run_module m
5756
++ PassManager.dispose)
5857

0 commit comments

Comments
 (0)