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