1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
8 ; CHECK-NEXT: br label [[BB1:%.*]]
10 ; CHECK-NEXT: [[X:%.*]] = phi i32 [ -29, [[ENTRY:%.*]] ], [ 0, [[BB1]] ]
11 ; CHECK-NEXT: [[REM:%.*]] = srem i32 [[X]], 2
12 ; CHECK-NEXT: [[T:%.*]] = icmp eq i32 [[REM]], -1
13 ; CHECK-NEXT: br i1 [[T]], label [[BB2:%.*]], label [[BB1]]
15 ; CHECK-NEXT: ret i32 [[X]]
20 BB1: ; preds = %BB1, %entry
21 %x = phi i32 [ -29, %entry ], [ 0, %BB1 ] ; <i32> [#uses=2]
22 %rem = srem i32 %x, 2 ; <i32> [#uses=1]
23 %t = icmp eq i32 %rem, -1 ; <i1> [#uses=1]
24 br i1 %t, label %BB2, label %BB1