@@ -237,8 +237,7 @@ class InductiveRangeCheckElimination {
237
237
DominatorTree &DT;
238
238
LoopInfo &LI;
239
239
240
- using GetBFIFunc =
241
- std::optional<llvm::function_ref<llvm::BlockFrequencyInfo &()>>;
240
+ using GetBFIFunc = llvm::function_ref<llvm::BlockFrequencyInfo &()>;
242
241
GetBFIFunc GetBFI;
243
242
244
243
// Returns the estimated number of iterations based on block frequency info if
@@ -249,7 +248,7 @@ class InductiveRangeCheckElimination {
249
248
public:
250
249
InductiveRangeCheckElimination (ScalarEvolution &SE,
251
250
BranchProbabilityInfo *BPI, DominatorTree &DT,
252
- LoopInfo &LI, GetBFIFunc GetBFI = std::nullopt )
251
+ LoopInfo &LI, GetBFIFunc GetBFI = nullptr )
253
252
: SE(SE), BPI(BPI), DT(DT), LI(LI), GetBFI(GetBFI) {}
254
253
255
254
bool run (Loop *L, function_ref<void (Loop *, bool )> LPMAddNewLoop);
@@ -959,7 +958,7 @@ PreservedAnalyses IRCEPass::run(Function &F, FunctionAnalysisManager &AM) {
959
958
std::optional<uint64_t >
960
959
InductiveRangeCheckElimination::estimatedTripCount (const Loop &L) {
961
960
if (GetBFI) {
962
- BlockFrequencyInfo &BFI = (* GetBFI) ();
961
+ BlockFrequencyInfo &BFI = GetBFI ();
963
962
uint64_t hFreq = BFI.getBlockFreq (L.getHeader ()).getFrequency ();
964
963
uint64_t phFreq = BFI.getBlockFreq (L.getLoopPreheader ()).getFrequency ();
965
964
if (phFreq == 0 || hFreq == 0 )
0 commit comments