From: Wei Mi Date: Tue, 5 Feb 2019 00:57:50 +0000 (+0000) Subject: [SamplePGO][NFC] Minor improvement to replace a temporary vector with a X-Git-Tag: llvmorg-10-init~12812 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4901f371a2808d52f886e76717f20ba4615c9f07;p=platform%2Fupstream%2Fllvm.git [SamplePGO][NFC] Minor improvement to replace a temporary vector with a brace-enclosed init list. Differential Revision: https://reviews.llvm.org/D57726 llvm-svn: 353129 --- diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp index bc2ceec..7483184 100644 --- a/llvm/lib/Transforms/IPO/SampleProfile.cpp +++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -1327,9 +1327,8 @@ void SampleProfileLoader::propagateWeights(Function &F) { 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]})); } } }