Fix comment in llvm.mli.
[oota-llvm.git] / test / Transforms / LICM / sink_load.ll
1 ; To reduce register pressure, if a load is hoistable out of the loop, and the
2 ; result of the load is only used outside of the loop, sink the load instead of
3 ; hoisting it!
4 ;
5 ; RUN: llvm-as < %s | opt -licm | llvm-dis | %prcontext load 1 | grep Out: 
6
7 @X = global i32 5               ; <i32*> [#uses=1]
8
9 define i32 @test(i32 %N) {
10 Entry:
11         br label %Loop
12 Loop:           ; preds = %Loop, %Entry
13         %N_addr.0.pn = phi i32 [ %dec, %Loop ], [ %N, %Entry ]          ; <i32> [#uses=2]
14         %tmp.6 = load i32* @X           ; <i32> [#uses=1]
15         %dec = add i32 %N_addr.0.pn, -1         ; <i32> [#uses=1]
16         %tmp.1 = icmp ne i32 %N_addr.0.pn, 1            ; <i1> [#uses=1]
17         br i1 %tmp.1, label %Loop, label %Out
18 Out:            ; preds = %Loop
19         ret i32 %tmp.6
20 }
21