1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-02 00:42:52 +01:00
llvm-mirror/test/Transforms/InstCombine/sink_instruction.ll

20 lines
521 B
LLVM
Raw Normal View History

; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
; RUN: %prcontext div 1 | grep ret
2004-12-09 00:41:16 +01:00
;; This tests that the instructions in the entry blocks are sunk into each
;; arm of the 'if'.
define i32 @foo(i1 %C, i32 %A, i32 %B) {
2004-12-09 00:41:16 +01:00
entry:
%tmp.2 = sdiv i32 %A, %B ; <i32> [#uses=1]
%tmp.9 = add i32 %B, %A ; <i32> [#uses=1]
br i1 %C, label %then, label %endif
2004-12-09 00:41:16 +01:00
then: ; preds = %entry
ret i32 %tmp.9
2004-12-09 00:41:16 +01:00
endif: ; preds = %entry
ret i32 %tmp.2
2004-12-09 00:41:16 +01:00
}