Index: lib/Transforms/IPO/SampleProfile.cpp =================================================================== --- lib/Transforms/IPO/SampleProfile.cpp +++ lib/Transforms/IPO/SampleProfile.cpp @@ -1300,9 +1300,8 @@ SortedCallTargets, Sum, IPVK_IndirectCallTarget, SortedCallTargets.size()); } else if (!dyn_cast(&I)) { - SmallVector Weights; - Weights.push_back(BlockWeights[BB]); - I.setMetadata(LLVMContext::MD_prof, MDB.createBranchWeights(Weights)); + I.setMetadata(LLVMContext::MD_prof, + MDB.createBranchWeights({BlockWeights[BB]})); } } }