]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Transforms/InstCombine/sink_instruction.ll
Import LLVM, at r72732.
[FreeBSD/FreeBSD.git] / test / Transforms / InstCombine / sink_instruction.ll
1 ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
2 ; RUN:   %prcontext div 1 | grep ret
3
4 ;; This tests that the instructions in the entry blocks are sunk into each
5 ;; arm of the 'if'.
6
7 define i32 @foo(i1 %C, i32 %A, i32 %B) {
8 entry:
9         %tmp.2 = sdiv i32 %A, %B                ; <i32> [#uses=1]
10         %tmp.9 = add i32 %B, %A         ; <i32> [#uses=1]
11         br i1 %C, label %then, label %endif
12
13 then:           ; preds = %entry
14         ret i32 %tmp.9
15
16 endif:          ; preds = %entry
17         ret i32 %tmp.2
18 }
19