aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-06-25 23:05:46 +0000
committerJim Grosbach <grosbach@apple.com>2010-06-25 23:05:46 +0000
commit9f054f017c7bced071f5a4de606cec6751edd23f (patch)
tree0f2359b8128b6788420cd55a122a2f74ab95bd45 /lib/CodeGen
parent95325b08a33dbce40f4d1faa2dfada40cac6cec5 (diff)
downloadexternal_llvm-9f054f017c7bced071f5a4de606cec6751edd23f.zip
external_llvm-9f054f017c7bced071f5a4de606cec6751edd23f.tar.gz
external_llvm-9f054f017c7bced071f5a4de606cec6751edd23f.tar.bz2
make sure to handle dbg_value instructions in the middle of the block, not
just at the head, when doing diamond if-conversion. rdar://7797940 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106907 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/IfConversion.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/IfConversion.cpp b/lib/CodeGen/IfConversion.cpp
index ea4e68d..51fea7f 100644
--- a/lib/CodeGen/IfConversion.cpp
+++ b/lib/CodeGen/IfConversion.cpp
@@ -1228,10 +1228,18 @@ bool IfConverter::IfConvertDiamond(BBInfo &BBI, IfcvtKind Kind,
++DI2;
BBI1->NonPredSize -= NumDups1;
BBI2->NonPredSize -= NumDups1;
- while (NumDups1 != 0) {
+
+ // Skip past the dups on each side separately since there may be
+ // differing dbg_value entries.
+ for (unsigned i = 0; i < NumDups1; ++i) {
++DI1;
+ if (!DI1->isDebugValue())
+ ++i;
+ }
+ while (NumDups1 != 0) {
++DI2;
- --NumDups1;
+ if (!DI2->isDebugValue())
+ --NumDups1;
}
UpdatePredRedefs(BBI1->BB->begin(), DI1, Redefs, TRI);