aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Instructions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r--llvm/lib/IR/Instructions.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 445323f..52e25a8 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -4002,11 +4002,7 @@ void SwitchInstProfUpdateWrapper::init() {
if (!ProfileData)
return;
- // FIXME: This check belongs in ProfDataUtils. Its almost equivalent to
- // getValidBranchWeightMDNode(), but the need to use llvm_unreachable
- // makes them slightly different.
- if (ProfileData->getNumOperands() !=
- SI.getNumSuccessors() + getBranchWeightOffset(ProfileData)) {
+ if (getNumBranchWeights(*ProfileData) != SI.getNumSuccessors()) {
llvm_unreachable("number of prof branch_weights metadata operands does "
"not correspond to number of succesors");
}