diff options
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index d66ec8f8d45..5cd52f7721c 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -1120,28 +1120,6 @@ void BranchInst::swapSuccessors() { MDNode::get(ProfileData->getContext(), Ops)); } -bool BranchInst::extractProfMetadata(uint64_t &TrueVal, uint64_t &FalseVal) { - assert(isConditional() && - "Looking for probabilities on unconditional branch?"); - auto *ProfileData = getMetadata(LLVMContext::MD_prof); - if (!ProfileData || ProfileData->getNumOperands() != 3) - return false; - - auto *ProfDataName = dyn_cast<MDString>(ProfileData->getOperand(0)); - if (!ProfDataName || !ProfDataName->getString().equals("branch_weights")) - return false; - - auto *CITrue = mdconst::dyn_extract<ConstantInt>(ProfileData->getOperand(1)); - auto *CIFalse = mdconst::dyn_extract<ConstantInt>(ProfileData->getOperand(2)); - if (!CITrue || !CIFalse) - return false; - - TrueVal = CITrue->getValue().getZExtValue(); - FalseVal = CIFalse->getValue().getZExtValue(); - - return true; -} - BasicBlock *BranchInst::getSuccessorV(unsigned idx) const { return getSuccessor(idx); } |