mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Unreachable block is not a root node in post dominator tree.
llvm-svn: 40458
This commit is contained in:
parent
5969a3cb91
commit
aa2a753350
@ -112,8 +112,12 @@ void PostDominatorTree::calculate(Function &F) {
|
||||
// relationships. These blocks, which have no successors, end with return and
|
||||
// unwind instructions.
|
||||
for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
|
||||
if (succ_begin(I) == succ_end(I))
|
||||
Roots.push_back(I);
|
||||
if (succ_begin(I) == succ_end(I)) {
|
||||
Instruction *Insn = I->getTerminator();
|
||||
// Unreachable block is not a root node.
|
||||
if (!isa<UnreachableInst>(Insn))
|
||||
Roots.push_back(I);
|
||||
}
|
||||
|
||||
Vertex.push_back(0);
|
||||
|
||||
|
13
test/Transforms/ADCE/2007-07-23-InfiniteLoop.ll
Normal file
13
test/Transforms/ADCE/2007-07-23-InfiniteLoop.ll
Normal file
@ -0,0 +1,13 @@
|
||||
; RUN: llvm-as < %s | opt -adce | llvm-dis | grep switch
|
||||
; PR 1564
|
||||
|
||||
define fastcc void @out() {
|
||||
start:
|
||||
br label %loop
|
||||
unreachable:
|
||||
unreachable
|
||||
loop:
|
||||
switch i32 0, label %unreachable [
|
||||
i32 0, label %loop
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user