[InstCombine] Add tests for funnel shift with zero operand; NFC

These are additional baseline tests for D54778.

llvm-svn: 347414
This commit is contained in:
Nikita Popov 2018-11-21 20:34:11 +00:00
parent 584d935351
commit a70fdf8635
1 changed files with 36 additions and 0 deletions

View File

@ -152,6 +152,15 @@ define i32 @fshl_op0_undef(i32 %x) {
ret i32 %r
}
define i32 @fshl_op0_zero(i32 %x) {
; CHECK-LABEL: @fshl_op0_zero(
; CHECK-NEXT: [[R:%.*]] = call i32 @llvm.fshl.i32(i32 0, i32 [[X:%.*]], i32 7)
; CHECK-NEXT: ret i32 [[R]]
;
%r = call i32 @llvm.fshl.i32(i32 0, i32 %x, i32 7)
ret i32 %r
}
define i33 @fshr_op0_undef(i33 %x) {
; CHECK-LABEL: @fshr_op0_undef(
; CHECK-NEXT: [[R:%.*]] = call i33 @llvm.fshr.i33(i33 undef, i33 [[X:%.*]], i33 7)
@ -161,6 +170,15 @@ define i33 @fshr_op0_undef(i33 %x) {
ret i33 %r
}
define i33 @fshr_op0_zero(i33 %x) {
; CHECK-LABEL: @fshr_op0_zero(
; CHECK-NEXT: [[R:%.*]] = call i33 @llvm.fshr.i33(i33 0, i33 [[X:%.*]], i33 7)
; CHECK-NEXT: ret i33 [[R]]
;
%r = call i33 @llvm.fshr.i33(i33 0, i33 %x, i33 7)
ret i33 %r
}
define i32 @fshl_op1_undef(i32 %x) {
; CHECK-LABEL: @fshl_op1_undef(
; CHECK-NEXT: [[R:%.*]] = call i32 @llvm.fshl.i32(i32 [[X:%.*]], i32 undef, i32 7)
@ -170,6 +188,15 @@ define i32 @fshl_op1_undef(i32 %x) {
ret i32 %r
}
define i32 @fshl_op1_zero(i32 %x) {
; CHECK-LABEL: @fshl_op1_zero(
; CHECK-NEXT: [[R:%.*]] = call i32 @llvm.fshl.i32(i32 [[X:%.*]], i32 0, i32 7)
; CHECK-NEXT: ret i32 [[R]]
;
%r = call i32 @llvm.fshl.i32(i32 %x, i32 0, i32 7)
ret i32 %r
}
define i33 @fshr_op1_undef(i33 %x) {
; CHECK-LABEL: @fshr_op1_undef(
; CHECK-NEXT: [[R:%.*]] = call i33 @llvm.fshr.i33(i33 [[X:%.*]], i33 undef, i33 7)
@ -179,6 +206,15 @@ define i33 @fshr_op1_undef(i33 %x) {
ret i33 %r
}
define i33 @fshr_op1_zero(i33 %x) {
; CHECK-LABEL: @fshr_op1_zero(
; CHECK-NEXT: [[R:%.*]] = call i33 @llvm.fshr.i33(i33 [[X:%.*]], i33 0, i33 7)
; CHECK-NEXT: ret i33 [[R]]
;
%r = call i33 @llvm.fshr.i33(i33 %x, i33 0, i33 7)
ret i33 %r
}
; Only demand bits from one of the operands.
define i32 @fshl_only_op0_demanded(i32 %x, i32 %y) {