diff options
-rw-r--r-- | llvm/lib/Analysis/ProfileSummaryInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp index f3dc8b48732..7397073a06d 100644 --- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp +++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp @@ -84,9 +84,13 @@ bool ProfileSummaryInfo::isHotFunction(const Function *F) { // example, no profile data is available). bool ProfileSummaryInfo::isColdFunction(const Function *F) { computeSummary(); + if (!F) + return false; if (F->hasFnAttribute(Attribute::Cold)) { return true; } + if (!Summary) + return false; auto FunctionCount = F->getEntryCount(); // FIXME: The heuristic used below for determining coldness is based on // preliminary SPEC tuning for inliner. This will eventually be a |