[InstCombine] add more tests for vector cmp-bitcast; NFC

D107170
This commit is contained in:
Sanjay Patel 2021-07-30 14:11:28 -04:00
parent c6d147b0a5
commit e5d9831cf2
1 changed files with 41 additions and 0 deletions

View File

@ -478,6 +478,47 @@ define i1 @slt_cast_ne-1(<2 x i4> %x, <2 x i4> %y) {
ret i1 %r
}
define i1 @ueq_cast_eq-1(<3 x float> %x, <3 x float> %y) {
; CHECK-LABEL: @ueq_cast_eq-1(
; CHECK-NEXT: [[FC:%.*]] = fcmp ueq <3 x float> [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: [[B:%.*]] = bitcast <3 x i1> [[FC]] to i3
; CHECK-NEXT: [[R:%.*]] = icmp eq i3 [[B]], -1
; CHECK-NEXT: ret i1 [[R]]
;
%fc = fcmp ueq <3 x float> %x, %y
%b = bitcast <3 x i1> %fc to i3
%r = icmp eq i3 %b, -1
ret i1 %r
}
define i1 @not_cast_ne-1(<3 x i1> %x) {
; CHECK-LABEL: @not_cast_ne-1(
; CHECK-NEXT: [[NOT:%.*]] = xor <3 x i1> [[X:%.*]], <i1 true, i1 true, i1 true>
; CHECK-NEXT: [[B:%.*]] = bitcast <3 x i1> [[NOT]] to i3
; CHECK-NEXT: [[R:%.*]] = icmp ne i3 [[B]], -1
; CHECK-NEXT: ret i1 [[R]]
;
%not = xor <3 x i1> %x, <i1 -1, i1 -1, i1 -1>
%b = bitcast <3 x i1> %not to i3
%r = icmp ne i3 %b, -1
ret i1 %r
}
define i1 @not_cast_ne-1_uses(<3 x i2> %x, <3 x i2>* %p) {
; CHECK-LABEL: @not_cast_ne-1_uses(
; CHECK-NEXT: [[NOT:%.*]] = xor <3 x i2> [[X:%.*]], <i2 -1, i2 -1, i2 -1>
; CHECK-NEXT: store <3 x i2> [[NOT]], <3 x i2>* [[P:%.*]], align 4
; CHECK-NEXT: [[B:%.*]] = bitcast <3 x i2> [[NOT]] to i6
; CHECK-NEXT: [[R:%.*]] = icmp ne i6 [[B]], -1
; CHECK-NEXT: ret i1 [[R]]
;
%not = xor <3 x i2> %x, <i2 -1, i2 -1, i2 -1>
store <3 x i2> %not, <3 x i2>* %p
%b = bitcast <3 x i2> %not to i6
%r = icmp ne i6 %b, -1
ret i1 %r
}
define i1 @eq_cast_sgt-1(<3 x i4> %x, <3 x i4> %y) {
; CHECK-LABEL: @eq_cast_sgt-1(
; CHECK-NEXT: [[IC:%.*]] = icmp eq <3 x i4> [[X:%.*]], [[Y:%.*]]