1 ; RUN: opt < %s -instsimplify -S | FileCheck %s 2 3 define i32 @select1(i32 %x, i1 %b) { 4 ; CHECK: @select1 5 %rhs = select i1 %b, i32 %x, i32 1 6 %rem = srem i32 %x, %rhs 7 ret i32 %rem 8 ; CHECK: ret i32 0 9 } 10 11 define i32 @select2(i32 %x, i1 %b) { 12 ; CHECK: @select2 13 %rhs = select i1 %b, i32 %x, i32 1 14 %rem = urem i32 %x, %rhs 15 ret i32 %rem 16 ; CHECK: ret i32 0 17 } 18