mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-14 23:29:51 +00:00
PR4662: Fix a crash introduced by the recent LLVMContext changes.
llvm-svn: 77716
This commit is contained in:
parent
481c23300a
commit
7bb0485237
@ -360,7 +360,8 @@ void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) {
|
|||||||
Instruction *Inst = BI++;
|
Instruction *Inst = BI++;
|
||||||
if (isInstructionTriviallyDead(Inst))
|
if (isInstructionTriviallyDead(Inst))
|
||||||
Inst->eraseFromParent();
|
Inst->eraseFromParent();
|
||||||
else if (Constant *C = ConstantFoldInstruction(Inst, BI->getContext())) {
|
else if (Constant *C = ConstantFoldInstruction(Inst,
|
||||||
|
Inst->getContext())) {
|
||||||
Inst->replaceAllUsesWith(C);
|
Inst->replaceAllUsesWith(C);
|
||||||
Inst->eraseFromParent();
|
Inst->eraseFromParent();
|
||||||
}
|
}
|
||||||
|
14
test/Transforms/TailDup/2009-07-31-phicrash.ll
Normal file
14
test/Transforms/TailDup/2009-07-31-phicrash.ll
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
; RUN: llvm-as < %s | opt -tailduplicate -disable-output
|
||||||
|
; PR4662
|
||||||
|
|
||||||
|
define void @a() {
|
||||||
|
BB:
|
||||||
|
br label %BB6
|
||||||
|
|
||||||
|
BB6:
|
||||||
|
%tmp9 = phi i64 [ 0, %BB ], [ 5, %BB34 ]
|
||||||
|
br label %BB34
|
||||||
|
|
||||||
|
BB34:
|
||||||
|
br label %BB6
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user