From: Dale Johannesen Date: Tue, 17 Mar 2009 00:38:24 +0000 (+0000) Subject: Fix a debug info dependency in jump threading. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6b233395025069f63156ea2b524cdb708a14731f;p=oota-llvm.git Fix a debug info dependency in jump threading. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67064 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp index f96fc208ae1..69d17993b53 100644 --- a/lib/Transforms/Scalar/JumpThreading.cpp +++ b/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(BBI)) + BBI++; // FIXME: Thread if it just contains a PHI. - if (isa(DestBB->begin())) { + if (isa(BBI)) { bool MadeChange = false; // Ignore the default edge for now. for (unsigned i = 1, e = DestSI->getNumSuccessors(); i != e; ++i) {