comparison test/Transforms/ADCE/2003-04-25-PHIPostDominateProblem.ll @ 0:95c75e76d11b LLVM3.4

LLVM 3.4
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Thu, 12 Dec 2013 13:56:28 +0900
parents
children 803732b1fca8
comparison
equal deleted inserted replaced
-1:000000000000 0:95c75e76d11b
1 ; THis testcase caused an assertion failure because a PHI node did not have
2 ; entries for it's postdominator. But I think this can only happen when the
3 ; PHI node is dead, so we just avoid patching up dead PHI nodes.
4
5 ; RUN: opt < %s -adce
6
7 target datalayout = "e-p:32:32"
8
9 define void @dead_test8() {
10 entry:
11 br label %loopentry
12
13 loopentry: ; preds = %endif, %entry
14 %k.1 = phi i32 [ %k.0, %endif ], [ 0, %entry ] ; <i32> [#uses=1]
15 br i1 false, label %no_exit, label %return
16
17 no_exit: ; preds = %loopentry
18 br i1 false, label %then, label %else
19
20 then: ; preds = %no_exit
21 br label %endif
22
23 else: ; preds = %no_exit
24 %dec = add i32 %k.1, -1 ; <i32> [#uses=1]
25 br label %endif
26
27 endif: ; preds = %else, %then
28 %k.0 = phi i32 [ %dec, %else ], [ 0, %then ] ; <i32> [#uses=1]
29 store i32 2, i32* null
30 br label %loopentry
31
32 return: ; preds = %loopentry
33 ret void
34 }
35