llvm.org GIT mirror llvm / 6f285d2
fix PR6743, a case where we'd delete an instruction before using it in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100937 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
2 changed file(s) with 20 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
669669 Value *OldCond = DestBI->getCondition();
670670 DestBI->setCondition(ConstantInt::get(Type::getInt1Ty(BB->getContext()),
671671 BranchDir));
672 // Delete dead instructions before we fold the branch. Folding the branch
673 // can eliminate edges from the CFG which can end up deleting OldCond.
674 RecursivelyDeleteTriviallyDeadInstructions(OldCond);
672675 ConstantFoldTerminator(BB);
673 RecursivelyDeleteTriviallyDeadInstructions(OldCond);
674676 return true;
675677 }
676678
323323 call void undef(i64 ptrtoint (i8* blockaddress(@test11, %A) to i64)) nounwind
324324 unreachable
325325 }
326
327 ; PR6743
328 define void @test12() nounwind ssp {
329 entry:
330 br label %lbl_51
331
332 lbl_51: ; preds = %if.then, %entry
333 %tmp3 = phi i1 [ false, %if.then ], [ undef, %entry ] ; [#uses=2]
334 br i1 %tmp3, label %if.end12, label %if.then
335
336 if.then: ; preds = %lbl_51
337 br i1 %tmp3, label %lbl_51, label %if.end12
338
339 if.end12: ; preds = %if.then, %lbl_51
340 ret void
341 }
342