Remove a dangling reference to a deleted instruction. Fixes PR13185!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159096 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2012-06-24 01:44:08 +00:00
parent 6e2db65266
commit 917f99354f
2 changed files with 12 additions and 0 deletions

View File

@ -1478,6 +1478,7 @@ void Reassociate::EraseInst(Instruction *I) {
SmallVector<Value*, 8> Ops(I->op_begin(), I->op_end());
// Erase the dead instruction.
ValueRankMap.erase(I);
RedoInsts.remove(I);
I->eraseFromParent();
// Optimize its operands.
SmallPtrSet<Instruction *, 8> Visited; // Detect self-referential nodes.

View File

@ -108,3 +108,14 @@ unreachable4:
%z4 = add i32 %y4, %y4
ret void
}
; PR13185
define void @pr13185(i16 %p) {
entry:
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%x.0 = phi i32 [ undef, %entry ], [ %conv, %for.cond ]
%conv = zext i16 %p to i32
br label %for.cond
}