Skip to content

Commit c71b212

Browse files
committed
ProfDataUtils: Avoid dyn_extract + assert (NFC)
1 parent 5a03823 commit c71b212

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/IR/ProfDataUtils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ bool extractProfTotalWeight(const MDNode *ProfileData, uint64_t &TotalVal) {
216216
if (ProfDataName->getString() == "branch_weights") {
217217
unsigned Offset = getBranchWeightOffset(ProfileData);
218218
for (unsigned Idx = Offset; Idx < ProfileData->getNumOperands(); ++Idx) {
219-
auto *V = mdconst::dyn_extract<ConstantInt>(ProfileData->getOperand(Idx));
220-
assert(V && "Malformed branch_weight in MD_prof node");
219+
auto *V = mdconst::extract<ConstantInt>(ProfileData->getOperand(Idx));
221220
TotalVal += V->getValue().getZExtValue();
222221
}
223222
return true;

0 commit comments

Comments
 (0)