1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[InstCombine] add tests for urem with sext bool divisor; NFC

llvm-svn: 335619
This commit is contained in:
Sanjay Patel 2018-06-26 16:01:24 +00:00
parent 88b1bcbfc3
commit 0fb77c5c0e

View File

@ -58,6 +58,28 @@ define i5 @biggest_divisor(i5 %x) {
ret i5 %rem
}
define i8 @urem_with_sext_bool_divisor(i1 %x, i8 %y) {
; CHECK-LABEL: @urem_with_sext_bool_divisor(
; CHECK-NEXT: [[S:%.*]] = sext i1 [[X:%.*]] to i8
; CHECK-NEXT: [[REM:%.*]] = urem i8 [[Y:%.*]], [[S]]
; CHECK-NEXT: ret i8 [[REM]]
;
%s = sext i1 %x to i8
%rem = urem i8 %y, %s
ret i8 %rem
}
define <2 x i8> @urem_with_sext_bool_divisor_vec(<2 x i1> %x, <2 x i8> %y) {
; CHECK-LABEL: @urem_with_sext_bool_divisor_vec(
; CHECK-NEXT: [[S:%.*]] = sext <2 x i1> [[X:%.*]] to <2 x i8>
; CHECK-NEXT: [[REM:%.*]] = urem <2 x i8> [[Y:%.*]], [[S]]
; CHECK-NEXT: ret <2 x i8> [[REM]]
;
%s = sext <2 x i1> %x to <2 x i8>
%rem = urem <2 x i8> %y, %s
ret <2 x i8> %rem
}
define <2 x i4> @big_divisor_vec(<2 x i4> %x) {
; CHECK-LABEL: @big_divisor_vec(
; CHECK-NEXT: [[TMP1:%.*]] = icmp ult <2 x i4> [[X:%.*]], <i4 -3, i4 -3>