diff options
author | Zhou Sheng <zhousheng00@gmail.com> | 2009-02-25 15:34:27 +0000 |
---|---|---|
committer | Zhou Sheng <zhousheng00@gmail.com> | 2009-02-25 15:34:27 +0000 |
commit | 9a7c743fc0d45e4f2331c4092d3f29bf18351e6f (patch) | |
tree | 17b90170a6740b7a29b545706c06e24cf8116fd9 /lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 326a4988ba1fcafec7f582e490e56f0f7297c4fc (diff) |
Don't block basic block with only SwitchInst to fold into predecessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65456 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 6c14a643e8..08c8a3f65e 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1887,7 +1887,11 @@ bool llvm::SimplifyCFG(BasicBlock *BB) { // If the block only contains the switch, see if we can fold the block // away into any preds. - if (SI == &BB->front()) + BasicBlock::iterator BBI = BB->begin(); + // Ignore dbg intrinsics. + while (isa<DbgInfoIntrinsic>(BBI)) + ++BBI; + if (SI == &*BBI) if (FoldValueComparisonIntoPredecessors(SI)) return SimplifyCFG(BB) || 1; } |