Skip to content

Commit 4901f37

Browse files
committedFeb 5, 2019
[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
1 parent 2bf74ec commit 4901f37

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎llvm/lib/Transforms/IPO/SampleProfile.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -1327,9 +1327,8 @@ void SampleProfileLoader::propagateWeights(Function &F) {
13271327
SortedCallTargets, Sum, IPVK_IndirectCallTarget,
13281328
SortedCallTargets.size());
13291329
} else if (!dyn_cast<IntrinsicInst>(&I)) {
1330-
SmallVector<uint32_t, 1> Weights;
1331-
Weights.push_back(BlockWeights[BB]);
1332-
I.setMetadata(LLVMContext::MD_prof, MDB.createBranchWeights(Weights));
1330+
I.setMetadata(LLVMContext::MD_prof,
1331+
MDB.createBranchWeights({BlockWeights[BB]}));
13331332
}
13341333
}
13351334
}

0 commit comments

Comments
 (0)
Please sign in to comment.