@@ -237,8 +237,7 @@ class InductiveRangeCheckElimination {
237237 DominatorTree &DT;
238238 LoopInfo &LI;
239239
240- using GetBFIFunc =
241- std::optional<llvm::function_ref<llvm::BlockFrequencyInfo &()>>;
240+ using GetBFIFunc = llvm::function_ref<llvm::BlockFrequencyInfo &()>;
242241 GetBFIFunc GetBFI;
243242
244243 // Returns the estimated number of iterations based on block frequency info if
@@ -249,7 +248,7 @@ class InductiveRangeCheckElimination {
249248public:
250249 InductiveRangeCheckElimination (ScalarEvolution &SE,
251250 BranchProbabilityInfo *BPI, DominatorTree &DT,
252- LoopInfo &LI, GetBFIFunc GetBFI = std:: nullopt )
251+ LoopInfo &LI, GetBFIFunc GetBFI = nullptr )
253252 : SE(SE), BPI(BPI), DT(DT), LI(LI), GetBFI(GetBFI) {}
254253
255254 bool run (Loop *L, function_ref<void (Loop *, bool )> LPMAddNewLoop);
@@ -959,7 +958,7 @@ PreservedAnalyses IRCEPass::run(Function &F, FunctionAnalysisManager &AM) {
959958std::optional<uint64_t >
960959InductiveRangeCheckElimination::estimatedTripCount (const Loop &L) {
961960 if (GetBFI) {
962- BlockFrequencyInfo &BFI = (* GetBFI) ();
961+ BlockFrequencyInfo &BFI = GetBFI ();
963962 uint64_t hFreq = BFI.getBlockFreq (L.getHeader ()).getFrequency ();
964963 uint64_t phFreq = BFI.getBlockFreq (L.getLoopPreheader ()).getFrequency ();
965964 if (phFreq == 0 || hFreq == 0 )
0 commit comments