File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -1108,6 +1108,8 @@ bool EmitPass::runOnFunction(llvm::Function& F)
1108
1108
auto getFreqDigit = [&](Instruction *inst) {
1109
1109
MDNode *mn_digits =
1110
1110
termInst->getMetadata("stats.blockFrequency.digits");
1111
+ if (!mn_digits)
1112
+ return (unsigned long long)0;
1111
1113
return std::stoull(cast<MDString>(mn_digits->getOperand(0))
1112
1114
->getString()
1113
1115
.str());
@@ -1116,6 +1118,8 @@ bool EmitPass::runOnFunction(llvm::Function& F)
1116
1118
auto getFreqScale = [&](Instruction *inst) {
1117
1119
MDNode *mn_scale =
1118
1120
termInst->getMetadata("stats.blockFrequency.scale");
1121
+ if (!mn_scale)
1122
+ return (int16_t)0;
1119
1123
return (int16_t)std::stoi(
1120
1124
cast<MDString>(mn_scale->getOperand(0))
1121
1125
->getString()
You can’t perform that action at this time.
0 commit comments