summaryrefslogtreecommitdiff
path: root/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-05-18 01:28:58 +0000
committerDale Johannesen <dalej@apple.com>2007-05-18 01:28:58 +0000
commit1cf08c1d6d59cbeead241f44d898eaa2a3bf1717 (patch)
tree0ae69fcf5abcbb9e78042157f665bdf3211ebe58 /lib/CodeGen/BranchFolding.cpp
parente5e7ce458a2062dd9a8b495f4d73d359e0e269de (diff)
downloadllvm-1cf08c1d6d59cbeead241f44d898eaa2a3bf1717.tar.gz
llvm-1cf08c1d6d59cbeead241f44d898eaa2a3bf1717.tar.bz2
llvm-1cf08c1d6d59cbeead241f44d898eaa2a3bf1717.tar.xz
Remove some unneeded branches. (spotted by Evan, thanks)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r--lib/CodeGen/BranchFolding.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 7b4aaae482..d8ec340692 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -595,6 +595,7 @@ bool BranchFolder::TailMergeBlocks(MachineFunction &MF) {
// Reinsert an unconditional branch if needed.
// The 1 below can be either an original single predecessor, or a result
// of removing blocks in TryMergeBlocks.
+ PredBB = prior(I); // this may have been changed in TryMergeBlocks
if (MergePotentials.size()==1 &&
(MergePotentials.begin())->second != PredBB)
FixTail((MergePotentials.begin())->second, I, TII);