llvm.org GIT mirror llvm / 62e279b
Unreachable block is not a root node in post dominator tree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40458 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 12 years ago
2 changed file(s) with 19 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
111111 // relationships. These blocks, which have no successors, end with return and
112112 // unwind instructions.
113113 for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
114 if (succ_begin(I) == succ_end(I))
115 Roots.push_back(I);
114 if (succ_begin(I) == succ_end(I)) {
115 Instruction *Insn = I->getTerminator();
116 // Unreachable block is not a root node.
117 if (!isa(Insn))
118 Roots.push_back(I);
119 }
116120
117121 Vertex.push_back(0);
118122
0 ; RUN: llvm-as < %s | opt -adce | llvm-dis | grep switch
1 ; PR 1564
2
3 define fastcc void @out() {
4 start:
5 br label %loop
6 unreachable:
7 unreachable
8 loop:
9 switch i32 0, label %unreachable [
10 i32 0, label %loop
11 ]
12 }