19 lines · plain
1; RUN: opt < %s -passes=instcombine -S | FileCheck %s2 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 %endif7 8then: ; preds = %entry9; CHECK: then:10; CHECK-NEXT: sdiv i3211 br label %endif12 13endif: ; preds = %then, %entry14 %X = phi i32 [ %A, %then ], [ 15, %entry ] ; <i32> [#uses=1]15 %Y = sdiv i32 %X, 42 ; <i32> [#uses=1]16 ret i32 %Y17}18 19