Index: llvm/lib/Transforms/Scalar/JumpThreading.cpp =================================================================== --- llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -324,9 +324,9 @@ std::unique_ptr BFI; std::unique_ptr BPI; if (F.hasProfileData()) { - LoopInfo LI{DominatorTree(F)}; - BPI.reset(new BranchProbabilityInfo(F, LI, TLI)); - BFI.reset(new BlockFrequencyInfo(F, *BPI, LI)); + auto LI = &getAnalysis().getLoopInfo(); + BPI.reset(new BranchProbabilityInfo(F, *LI, TLI)); + BFI.reset(new BlockFrequencyInfo(F, *BPI, *LI)); } bool Changed = Impl.runImpl(F, TLI, TTI, LVI, AA, &DTU, F.hasProfileData(), @@ -353,7 +353,7 @@ std::unique_ptr BFI; std::unique_ptr BPI; if (F.hasProfileData()) { - LoopInfo LI{DominatorTree(F)}; + auto &LI = AM.getResult(F); BPI.reset(new BranchProbabilityInfo(F, LI, &TLI)); BFI.reset(new BlockFrequencyInfo(F, *BPI, LI)); }