summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2019-02-05 00:57:50 +0000
committerWei Mi <wmi@google.com>2019-02-05 00:57:50 +0000
commit4901f371a2808d52f886e76717f20ba4615c9f07 (patch)
tree39ead41aab5c35cb657f7071b35f9ef40c4cc13f /llvm/lib/Transforms/IPO
parent2bf74ec8c507dcb5cc71b21284cda98f6ba0e13e (diff)
downloadbcm5719-llvm-4901f371a2808d52f886e76717f20ba4615c9f07.tar.gz
bcm5719-llvm-4901f371a2808d52f886e76717f20ba4615c9f07.zip
[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
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/SampleProfile.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index bc2ceec8ba4..74831846626 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<IntrinsicInst>(&I)) {
- SmallVector<uint32_t, 1> Weights;
- Weights.push_back(BlockWeights[BB]);
- I.setMetadata(LLVMContext::MD_prof, MDB.createBranchWeights(Weights));
+ I.setMetadata(LLVMContext::MD_prof,
+ MDB.createBranchWeights({BlockWeights[BB]}));
}
}
}
OpenPOWER on IntegriCloud