1 ; LoopSimplify is breaking LICM on this testcase because the exit blocks from
2 ; the loop are reachable from more than just the exit nodes: the exit blocks
3 ; have predecessors from outside of the loop!
5 ; This is distilled from a monsterous crafty example.
7 ; RUN: llvm-as < %s | opt -licm | lli
9 %G = weak global int 0 ; <int*> [#uses=13]
11 implementation ; Functions:
15 store int 123, int* %G
18 loopentry.i: ; preds = %entry, %endif.1.i
19 %tmp.0.i = load int* %G ; <int> [#uses=1]
20 %tmp.1.i = seteq int %tmp.0.i, 123 ; <bool> [#uses=1]
21 br bool %tmp.1.i, label %Out.i, label %endif.0.i
23 endif.0.i: ; preds = %loopentry.i
24 %tmp.3.i = load int* %G ; <int> [#uses=1]
25 %tmp.4.i = seteq int %tmp.3.i, 126 ; <bool> [#uses=1]
26 br bool %tmp.4.i, label %ExitBlock.i, label %endif.1.i
28 endif.1.i: ; preds = %endif.0.i
29 %tmp.6.i = load int* %G ; <int> [#uses=1]
30 %inc.i = add int %tmp.6.i, 1 ; <int> [#uses=1]
31 store int %inc.i, int* %G
34 Out.i: ; preds = %loopentry.i
38 ExitBlock.i: ; preds = %endif.0.i, %Out.i
39 %tmp.7.i = load int* %G ; <int> [#uses=1]