Fix the assertion failure caused by http://reviews.llvm.org/D22118
Summary: http://reviews.llvm.org/D22118 uses metadata to store the call count, which makes it possible to have branch weight to have only one elements. Also fix the assertion failure in inliner when checking the instruction type to include "invoke" instruction. Reviewers: mkuper, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D22228 llvm-svn: 275079
This commit is contained in:
@@ -40,7 +40,7 @@ MDNode *MDBuilder::createBranchWeights(uint32_t TrueWeight,
|
||||
}
|
||||
|
||||
MDNode *MDBuilder::createBranchWeights(ArrayRef<uint32_t> Weights) {
|
||||
assert(Weights.size() >= 2 && "Need at least two branch weights!");
|
||||
assert(Weights.size() >= 1 && "Need at least one branch weights!");
|
||||
|
||||
SmallVector<Metadata *, 4> Vals(Weights.size() + 1);
|
||||
Vals[0] = createString("branch_weights");
|
||||
|
||||
Reference in New Issue
Block a user