summaryrefslogtreecommitdiff
path: root/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-05-26 21:49:28 +0000
committerDevang Patel <dpatel@apple.com>2011-05-26 21:49:28 +0000
commit95ba669e09c30f9aa1a7d754199548b8e6a227ce (patch)
treed28c717f58d127f80d383c1c21245793fb4c7df8 /lib/CodeGen/BranchFolding.cpp
parent785badb83e09ebae485c40f3fd86576581dd516e (diff)
downloadllvm-95ba669e09c30f9aa1a7d754199548b8e6a227ce.tar.gz
llvm-95ba669e09c30f9aa1a7d754199548b8e6a227ce.tar.bz2
llvm-95ba669e09c30f9aa1a7d754199548b8e6a227ce.tar.xz
Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r--lib/CodeGen/BranchFolding.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 2bcd59f1bd..719cd264f6 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -1056,10 +1056,13 @@ ReoptimizeBlock:
!MBB->hasAddressTaken() && !MBB->isLandingPad()) {
DEBUG(dbgs() << "\nMerging into block: " << PrevBB
<< "From MBB: " << *MBB);
+ // Remove redundant DBG_VALUEs first.
if (PrevBB.begin() != PrevBB.end()) {
MachineBasicBlock::iterator PrevBBIter = PrevBB.end();
--PrevBBIter;
MachineBasicBlock::iterator MBBIter = MBB->begin();
+ // Check if DBG_VALUE at the end of PrevBB is identical to the
+ // DBG_VALUE at the beginning of MBB.
while (PrevBBIter != PrevBB.begin() && MBBIter != MBB->end()
&& PrevBBIter->isDebugValue() && MBBIter->isDebugValue()) {
if (!MBBIter->isIdenticalTo(PrevBBIter))