1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt < %s -S -passes='instcombine<no-verify-fixpoint>' | FileCheck %s
4 ; We do not reach a fixpoint, because we first have to infer nsw on the IV add,
5 ; and could eliminate the icmp slt afterwards, but don't revisit it.
7 target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
10 ; CHECK-LABEL: define i32 @test() {
12 ; CHECK-NEXT: br i1 true, label [[BB_I:%.*]], label [[CALCULATECOLORSPECIFICBLACKLEVEL_EXIT:%.*]]
14 ; CHECK-NEXT: br label [[BB51_I_I:%.*]]
16 ; CHECK-NEXT: [[TMP50_I_I:%.*]] = add nsw i32 [[X_0_I_I:%.*]], 2
17 ; CHECK-NEXT: br label [[BB51_I_I]]
19 ; CHECK-NEXT: [[X_0_I_I]] = phi i32 [ [[TMP50_I_I]], [[BB27_I_I:%.*]] ], [ 0, [[BB_I]] ]
20 ; CHECK-NEXT: [[TMP54_I_I:%.*]] = icmp slt i32 [[X_0_I_I]], 0
21 ; CHECK-NEXT: br i1 [[TMP54_I_I]], label [[BB27_I_I]], label [[BB57_I_I:%.*]]
23 ; CHECK-NEXT: ret i32 0
24 ; CHECK: calculateColorSpecificBlackLevel.exit:
25 ; CHECK-NEXT: ret i32 undef
28 %tmp50.i17 = icmp slt i32 0, 4
29 br i1 %tmp50.i17, label %bb.i, label %calculateColorSpecificBlackLevel.exit
35 %tmp31.i.i = load i16, ptr null, align 2
36 %tmp35.i.i = icmp ult i16 %tmp31.i.i, 1
37 %tmp41.i.i = icmp ugt i16 %tmp31.i.i, -1
38 %bothcond.i.i = or i1 %tmp35.i.i, %tmp41.i.i
39 %bothcond1.i.i = zext i1 %bothcond.i.i to i32
40 %tmp46.i.i = xor i32 %bothcond1.i.i, 1
41 %count.0.i.i = add i32 %count.1.i.i, %tmp46.i.i
42 %tmp50.i.i = add i32 %x.0.i.i, 2
46 %count.1.i.i = phi i32 [ %count.0.i.i, %bb27.i.i ], [ 0, %bb.i ]
47 %x.0.i.i = phi i32 [ %tmp50.i.i, %bb27.i.i ], [ 0, %bb.i ]
48 %tmp54.i.i = icmp slt i32 %x.0.i.i, 0
49 br i1 %tmp54.i.i, label %bb27.i.i, label %bb57.i.i
54 calculateColorSpecificBlackLevel.exit: