From 30abbd4a2c71fdb23f2adfe2805c903c9779d9f8 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Fri, 13 Mar 2009 01:05:24 +0000 Subject: Fix one more place where debug info affected codegen (speculative execution). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66859 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/SimplifyCFG.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/Transforms/Utils/SimplifyCFG.cpp') diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index b8bac6d..925e3e9 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1069,9 +1069,12 @@ static bool SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *BB1) { } // If we get here, we can hoist the instruction. Try to place it - // before the icmp instruction preceeding the conditional branch. + // before the icmp instruction preceding the conditional branch. BasicBlock::iterator InsertPos = BI; - if (InsertPos != BIParent->begin()) + if (InsertPos != BIParent->begin()) + --InsertPos; + // Skip debug info between condition and branch. + while (InsertPos != BIParent->begin() && isa(InsertPos)) --InsertPos; if (InsertPos == BrCond && !isa(BrCond)) { SmallPtrSet BB1Insns; -- cgit v1.1