4848#include " llvm/Analysis/GlobalsModRef.h"
4949#include " llvm/Analysis/InstructionSimplify.h"
5050#include " llvm/Analysis/LazyBlockFrequencyInfo.h"
51- #include " llvm/Analysis/LoopInfo.h"
5251#include " llvm/Analysis/MemoryBuiltins.h"
5352#include " llvm/Analysis/OptimizationRemarkEmitter.h"
5453#include " llvm/Analysis/ProfileSummaryInfo.h"
@@ -5404,7 +5403,7 @@ static bool combineInstructionsOverFunction(
54045403 Function &F, InstructionWorklist &Worklist, AliasAnalysis *AA,
54055404 AssumptionCache &AC, TargetLibraryInfo &TLI, TargetTransformInfo &TTI,
54065405 DominatorTree &DT, OptimizationRemarkEmitter &ORE, BlockFrequencyInfo *BFI,
5407- BranchProbabilityInfo *BPI, ProfileSummaryInfo *PSI, LoopInfo *LI,
5406+ BranchProbabilityInfo *BPI, ProfileSummaryInfo *PSI,
54085407 const InstCombineOptions &Opts) {
54095408 auto &DL = F.getDataLayout ();
54105409
@@ -5443,7 +5442,7 @@ static bool combineInstructionsOverFunction(
54435442 << F.getName () << " \n " );
54445443
54455444 InstCombinerImpl IC (Worklist, Builder, F.hasMinSize (), AA, AC, TLI, TTI, DT,
5446- ORE, BFI, BPI, PSI, DL, LI, RPOT);
5445+ ORE, BFI, BPI, PSI, DL, RPOT);
54475446 IC.MaxArraySizeForCombine = MaxArraySize;
54485447 bool MadeChangeInThisIteration = IC.prepareWorklist (F);
54495448 MadeChangeInThisIteration |= IC.run ();
@@ -5480,7 +5479,6 @@ void InstCombinePass::printPipeline(
54805479 OS, MapClassName2PassName);
54815480 OS << ' <' ;
54825481 OS << " max-iterations=" << Options.MaxIterations << " ;" ;
5483- OS << (Options.UseLoopInfo ? " " : " no-" ) << " use-loop-info;" ;
54845482 OS << (Options.VerifyFixpoint ? " " : " no-" ) << " verify-fixpoint" ;
54855483 OS << ' >' ;
54865484}
@@ -5493,12 +5491,6 @@ PreservedAnalyses InstCombinePass::run(Function &F,
54935491 auto &ORE = AM.getResult <OptimizationRemarkEmitterAnalysis>(F);
54945492 auto &TTI = AM.getResult <TargetIRAnalysis>(F);
54955493
5496- // TODO: Only use LoopInfo when the option is set. This requires that the
5497- // callers in the pass pipeline explicitly set the option.
5498- auto *LI = AM.getCachedResult <LoopAnalysis>(F);
5499- if (!LI && Options.UseLoopInfo )
5500- LI = &AM.getResult <LoopAnalysis>(F);
5501-
55025494 auto *AA = &AM.getResult <AAManager>(F);
55035495 auto &MAMProxy = AM.getResult <ModuleAnalysisManagerFunctionProxy>(F);
55045496 ProfileSummaryInfo *PSI =
@@ -5508,7 +5500,7 @@ PreservedAnalyses InstCombinePass::run(Function &F,
55085500 auto *BPI = AM.getCachedResult <BranchProbabilityAnalysis>(F);
55095501
55105502 if (!combineInstructionsOverFunction (F, Worklist, AA, AC, TLI, TTI, DT, ORE,
5511- BFI, BPI, PSI, LI, Options))
5503+ BFI, BPI, PSI, Options))
55125504 // No changes, all analyses are preserved.
55135505 return PreservedAnalyses::all ();
55145506
@@ -5547,8 +5539,6 @@ bool InstructionCombiningPass::runOnFunction(Function &F) {
55475539 auto &ORE = getAnalysis<OptimizationRemarkEmitterWrapperPass>().getORE ();
55485540
55495541 // Optional analyses.
5550- auto *LIWP = getAnalysisIfAvailable<LoopInfoWrapperPass>();
5551- auto *LI = LIWP ? &LIWP->getLoopInfo () : nullptr ;
55525542 ProfileSummaryInfo *PSI =
55535543 &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI ();
55545544 BlockFrequencyInfo *BFI =
@@ -5561,8 +5551,7 @@ bool InstructionCombiningPass::runOnFunction(Function &F) {
55615551 BPI = &WrapperPass->getBPI ();
55625552
55635553 return combineInstructionsOverFunction (F, Worklist, AA, AC, TLI, TTI, DT, ORE,
5564- BFI, BPI, PSI, LI,
5565- InstCombineOptions ());
5554+ BFI, BPI, PSI, InstCombineOptions ());
55665555}
55675556
55685557char InstructionCombiningPass::ID = 0 ;
0 commit comments