summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-12-26 20:54:14 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-12-26 20:54:14 +0000
commit8d302df4a43e95c89de272adff79c71c61249990 (patch)
tree4aa77c903124d350e4a1b7ae16c818314e350ad9 /llvm/lib/Transforms
parente87d54c817d1c71e82d92632cdc9948f4c460e03 (diff)
downloadbcm5719-llvm-8d302df4a43e95c89de272adff79c71c61249990.tar.gz
bcm5719-llvm-8d302df4a43e95c89de272adff79c71c61249990.zip
Update the branch weight metadata when reversing the order of a branch.
llvm-svn: 147280
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 7835349771f..9604f5e4822 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1603,10 +1603,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
}
PBI->setCondition(NewCond);
- BasicBlock *OldTrue = PBI->getSuccessor(0);
- BasicBlock *OldFalse = PBI->getSuccessor(1);
- PBI->setSuccessor(0, OldFalse);
- PBI->setSuccessor(1, OldTrue);
+ PBI->swapSuccessors();
}
// If we have a bonus inst, clone it into the predecessor block.
OpenPOWER on IntegriCloud