2011-05-03 00:27:02 +08:00
|
|
|
; RUN: opt < %s -instsimplify -S | FileCheck %s
|
|
|
|
|
|
|
|
define i32 @select1(i32 %x, i1 %b) {
|
2013-07-14 09:42:54 +08:00
|
|
|
; CHECK-LABEL: @select1(
|
2011-05-03 00:27:02 +08:00
|
|
|
%rhs = select i1 %b, i32 %x, i32 1
|
|
|
|
%rem = srem i32 %x, %rhs
|
|
|
|
ret i32 %rem
|
|
|
|
; CHECK: ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @select2(i32 %x, i1 %b) {
|
2013-07-14 09:42:54 +08:00
|
|
|
; CHECK-LABEL: @select2(
|
2011-05-03 00:27:02 +08:00
|
|
|
%rhs = select i1 %b, i32 %x, i32 1
|
|
|
|
%rem = urem i32 %x, %rhs
|
|
|
|
ret i32 %rem
|
|
|
|
; CHECK: ret i32 0
|
|
|
|
}
|