@@ -1015,40 +1015,7 @@ PreservedAnalyses GuardWideningPass::run(Loop &L, LoopAnalysisManager &AM,
1015
1015
}
1016
1016
1017
1017
namespace {
1018
- struct GuardWideningLegacyPass : public FunctionPass {
1019
- static char ID;
1020
-
1021
- GuardWideningLegacyPass () : FunctionPass(ID) {
1022
- initializeGuardWideningLegacyPassPass (*PassRegistry::getPassRegistry ());
1023
- }
1024
-
1025
- bool runOnFunction (Function &F) override {
1026
- if (skipFunction (F))
1027
- return false ;
1028
- auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree ();
1029
- auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo ();
1030
- auto &AC = getAnalysis<AssumptionCacheTracker>().getAssumptionCache (F);
1031
- auto &PDT = getAnalysis<PostDominatorTreeWrapperPass>().getPostDomTree ();
1032
- auto *MSSAWP = getAnalysisIfAvailable<MemorySSAWrapperPass>();
1033
- std::unique_ptr<MemorySSAUpdater> MSSAU;
1034
- if (MSSAWP)
1035
- MSSAU = std::make_unique<MemorySSAUpdater>(&MSSAWP->getMSSA ());
1036
- return GuardWideningImpl (DT, &PDT, LI, AC, MSSAU ? MSSAU.get () : nullptr ,
1037
- DT.getRootNode (),
1038
- [](BasicBlock *) { return true ; })
1039
- .run ();
1040
- }
1041
-
1042
- void getAnalysisUsage (AnalysisUsage &AU) const override {
1043
- AU.setPreservesCFG ();
1044
- AU.addRequired <DominatorTreeWrapperPass>();
1045
- AU.addRequired <PostDominatorTreeWrapperPass>();
1046
- AU.addRequired <LoopInfoWrapperPass>();
1047
- AU.addPreserved <MemorySSAWrapperPass>();
1048
- }
1049
- };
1050
-
1051
- // / Same as above, but restricted to a single loop at a time. Can be
1018
+ // / Restricted to a single loop at a time. Can be
1052
1019
// / scheduled with other loop passes w/o breaking out of LPM
1053
1020
struct LoopGuardWideningLegacyPass : public LoopPass {
1054
1021
static char ID;
@@ -1091,17 +1058,8 @@ struct LoopGuardWideningLegacyPass : public LoopPass {
1091
1058
};
1092
1059
}
1093
1060
1094
- char GuardWideningLegacyPass::ID = 0 ;
1095
1061
char LoopGuardWideningLegacyPass::ID = 0 ;
1096
1062
1097
- INITIALIZE_PASS_BEGIN (GuardWideningLegacyPass, " guard-widening" , " Widen guards" ,
1098
- false , false )
1099
- INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
1100
- INITIALIZE_PASS_DEPENDENCY(PostDominatorTreeWrapperPass)
1101
- INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
1102
- INITIALIZE_PASS_END(GuardWideningLegacyPass, " guard-widening" , " Widen guards" ,
1103
- false , false )
1104
-
1105
1063
INITIALIZE_PASS_BEGIN (LoopGuardWideningLegacyPass, " loop-guard-widening" ,
1106
1064
" Widen guards (within a single loop, as a loop pass)" ,
1107
1065
false , false )
@@ -1112,10 +1070,6 @@ INITIALIZE_PASS_END(LoopGuardWideningLegacyPass, "loop-guard-widening",
1112
1070
" Widen guards (within a single loop, as a loop pass)" ,
1113
1071
false , false )
1114
1072
1115
- FunctionPass *llvm::createGuardWideningPass() {
1116
- return new GuardWideningLegacyPass ();
1117
- }
1118
-
1119
1073
Pass *llvm::createLoopGuardWideningPass() {
1120
1074
return new LoopGuardWideningLegacyPass ();
1121
1075
}
0 commit comments