diff options
author | Zhou Sheng <zhousheng00@gmail.com> | 2009-02-26 06:56:37 +0000 |
---|---|---|
committer | Zhou Sheng <zhousheng00@gmail.com> | 2009-02-26 06:56:37 +0000 |
commit | a8d57fe96bb870e4f69c6b522a78936d1495d0d2 (patch) | |
tree | d7cd0270b34cdff557a02ff5bb9b9e2ba9350489 /lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 677c2c2a6257657d85f16871addc93f37cd40454 (diff) |
Ignore dbg info intrinsics when folding conditional branch to
conditional branch predecessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | lib/Transforms/Utils/SimplifyCFG.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index 08c8a3f65e..25579614ec 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1592,7 +1592,11 @@ static bool SimplifyCondBranchToCondBranch(BranchInst *PBI, BranchInst *BI) { // If this is a conditional branch in an empty block, and if any // predecessors is a conditional branch to one of our destinations, // fold the conditions into logical ops and one cond br. - if (&BB->front() != BI) + BasicBlock::iterator BBI = BB->begin(); + // Ignore dbg intrinsics. + while (isa<DbgInfoIntrinsic>(BBI)) + ++BBI; + if (&*BBI != BI) return false; |