llvm.org GIT mirror llvm / d21e55a
PR4662: Fix a crash introduced by the recent LLVMContext changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77716 91177308-0d34-0410-b5e6-96231b3b80d8 Eli Friedman 10 years ago
2 changed file(s) with 16 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
359359 Instruction *Inst = BI++;
360360 if (isInstructionTriviallyDead(Inst))
361361 Inst->eraseFromParent();
362 else if (Constant *C = ConstantFoldInstruction(Inst, BI->getContext())) {
362 else if (Constant *C = ConstantFoldInstruction(Inst,
363 Inst->getContext())) {
363364 Inst->replaceAllUsesWith(C);
364365 Inst->eraseFromParent();
365366 }
0 ; RUN: llvm-as < %s | opt -tailduplicate -disable-output
1 ; PR4662
2
3 define void @a() {
4 BB:
5 br label %BB6
6
7 BB6:
8 %tmp9 = phi i64 [ 0, %BB ], [ 5, %BB34 ]
9 br label %BB34
10
11 BB34:
12 br label %BB6
13 }