1; RUN: opt < %s -instcombine -S | FileCheck %s
2
3;; This tests that the div is hoisted into the then block.
4define i32 @foo(i1 %C, i32 %A, i32 %B) {
5entry:
6        br i1 %C, label %then, label %endif
7
8then:           ; preds = %entry
9; CHECK: then:
10; CHECK-NEXT: sdiv i32
11        br label %endif
12
13endif:          ; preds = %then, %entry
14        %X = phi i32 [ %A, %then ], [ 15, %entry ]              ; <i32> [#uses=1]
15        %Y = sdiv i32 %X, 42            ; <i32> [#uses=1]
16        ret i32 %Y
17}
18
19