1; This testcase was extracted from the gzip SPEC benchmark
2;
3; RUN: opt < %s -adce | FileCheck %s
4
5@bk = external global i32               ; <i32*> [#uses=2]
6@hufts = external global i32            ; <i32*> [#uses=1]
7
8define i32 @inflate() {
9bb0:
10        br label %bb2
11
12bb2:            ; preds = %bb6, %bb0
13        %reg128 = phi i32 [ %reg130, %bb6 ], [ 0, %bb0 ]                ; <i32> [#uses=2]
14        br i1 true, label %bb4, label %bb3
15
16bb3:            ; preds = %bb2
17        br label %UnifiedExitNode
18
19; CHECK-NOT: bb4:
20; CHECK-NOT: bb5:
21bb4:            ; preds = %bb2
22        %reg117 = load i32, i32* @hufts              ; <i32> [#uses=2]
23        %cond241 = icmp ule i32 %reg117, %reg128                ; <i1> [#uses=1]
24        br i1 %cond241, label %bb6, label %bb5
25
26bb5:            ; preds = %bb4
27        br label %bb6
28
29bb6:            ; preds = %bb5, %bb4
30        %reg130 = phi i32 [ %reg117, %bb5 ], [ %reg128, %bb4 ]          ; <i32> [#uses=1]
31        br i1 false, label %bb2, label %bb7
32
33bb7:            ; preds = %bb6
34        %reg126 = load i32, i32* @bk         ; <i32> [#uses=1]
35        %cond247 = icmp ule i32 %reg126, 7              ; <i1> [#uses=1]
36        br i1 %cond247, label %bb9, label %bb8
37
38bb8:            ; preds = %bb8, %bb7
39        %reg119 = load i32, i32* @bk         ; <i32> [#uses=1]
40        %cond256 = icmp ugt i32 %reg119, 7              ; <i1> [#uses=1]
41        br i1 %cond256, label %bb8, label %bb9
42
43bb9:            ; preds = %bb8, %bb7
44        br label %UnifiedExitNode
45
46UnifiedExitNode:                ; preds = %bb9, %bb3
47        %UnifiedRetVal = phi i32 [ 7, %bb3 ], [ 0, %bb9 ]               ; <i32> [#uses=1]
48        ret i32 %UnifiedRetVal
49}
50
51