diff options
author | Xinliang David Li <davidxl@google.com> | 2016-08-23 15:39:03 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-08-23 15:39:03 +0000 |
commit | dc49140b4429c3eb0966f8169cd533660002ae41 (patch) | |
tree | 783ec039399dafbc974ee1c837c178cd23116ca6 /llvm/lib/IR/Instructions.cpp | |
parent | 298d5462970349ddb9acccad7ebdc5eb3476f7a5 (diff) | |
download | bcm5719-llvm-dc49140b4429c3eb0966f8169cd533660002ae41.tar.gz bcm5719-llvm-dc49140b4429c3eb0966f8169cd533660002ae41.zip |
[Profile] refactor meta data copying/swapping code
Differential Revision: http://reviews.llvm.org/D23619
llvm-svn: 279523
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 43d7927ce6a..5355f1a617a 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -1209,15 +1209,7 @@ void BranchInst::swapSuccessors() { // Update profile metadata if present and it matches our structural // expectations. - MDNode *ProfileData = getMetadata(LLVMContext::MD_prof); - if (!ProfileData || ProfileData->getNumOperands() != 3) - return; - - // The first operand is the name. Fetch them backwards and build a new one. - Metadata *Ops[] = {ProfileData->getOperand(0), ProfileData->getOperand(2), - ProfileData->getOperand(1)}; - setMetadata(LLVMContext::MD_prof, - MDNode::get(ProfileData->getContext(), Ops)); + swapProfMetadata(); } BasicBlock *BranchInst::getSuccessorV(unsigned idx) const { |