File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -696,7 +696,9 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
696
696
if (!PSI->isHotCallSite (CandidateCall, CallerBFI))
697
697
return false ;
698
698
699
- if (!F.getEntryCount ())
699
+ // Make sure we have a nonzero entry count.
700
+ auto EntryCount = F.getEntryCount ();
701
+ if (!EntryCount || !EntryCount.getCount ())
700
702
return false ;
701
703
702
704
BlockFrequencyInfo *CalleeBFI = &(GetBFI (F));
@@ -765,7 +767,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
765
767
766
768
// Compute the cycle savings per call.
767
769
auto EntryProfileCount = F.getEntryCount ();
768
- assert (EntryProfileCount.hasValue ());
770
+ assert (EntryProfileCount.hasValue () && EntryProfileCount. getCount () );
769
771
auto EntryCount = EntryProfileCount.getCount ();
770
772
CycleSavings += EntryCount / 2 ;
771
773
CycleSavings = CycleSavings.udiv (EntryCount);
You can’t perform that action at this time.
0 commit comments