diff options
author | Dale Johannesen <dalej@apple.com> | 2009-03-17 00:38:24 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-03-17 00:38:24 +0000 |
commit | 87077356be0090df8c647d49d3f58788f91418a6 (patch) | |
tree | 9bd8f3c0e4d7a1267b80ac2c34e78cac3df303b5 /llvm/lib/Transforms/Scalar/JumpThreading.cpp | |
parent | 4916c466daad2223ba6443ad6a48761cb63740ca (diff) | |
download | bcm5719-llvm-87077356be0090df8c647d49d3f58788f91418a6.tar.gz bcm5719-llvm-87077356be0090df8c647d49d3f58788f91418a6.zip |
Fix a debug info dependency in jump threading.
llvm-svn: 67064
Diffstat (limited to 'llvm/lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/JumpThreading.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index f96fc208ae1..69d17993b53 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -432,10 +432,13 @@ bool JumpThreading::ProcessSwitchOnDuplicateCond(BasicBlock *PredBB, // If DESTBB *just* contains the switch, then we can forward edges from PREDBB // directly to their destination. This does not introduce *any* code size - // growth. + // growth. Skip debug info first. + BasicBlock::iterator BBI = DestBB->begin(); + while (isa<DbgInfoIntrinsic>(BBI)) + BBI++; // FIXME: Thread if it just contains a PHI. - if (isa<SwitchInst>(DestBB->begin())) { + if (isa<SwitchInst>(BBI)) { bool MadeChange = false; // Ignore the default edge for now. for (unsigned i = 1, e = DestSI->getNumSuccessors(); i != e; ++i) { |