Skip to content

Commit

Permalink
[X86] Add test showing failure to remove freeze from all_of pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
RKSimon committed Sep 3, 2024
1 parent a70d999 commit 6c59dfb
Showing 1 changed file with 67 additions and 12 deletions.
79 changes: 67 additions & 12 deletions llvm/test/CodeGen/X86/movmsk-cmp.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4425,6 +4425,61 @@ define i32 @PR39665_c_ray_opt(<2 x double> %x, <2 x double> %y) {
ret i32 %r
}

define i32 @PR39665_c_ray_select(<2 x double> %x, <2 x double> %y) {
; SSE-LABEL: PR39665_c_ray_select:
; SSE: # %bb.0:
; SSE-NEXT: cmpltpd %xmm0, %xmm1
; SSE-NEXT: psllq $63, %xmm1
; SSE-NEXT: movmskpd %xmm1, %eax
; SSE-NEXT: cmpl $3, %eax
; SSE-NEXT: movl $42, %ecx
; SSE-NEXT: movl $99, %eax
; SSE-NEXT: cmovel %ecx, %eax
; SSE-NEXT: retq
;
; AVX1OR2-LABEL: PR39665_c_ray_select:
; AVX1OR2: # %bb.0:
; AVX1OR2-NEXT: vcmpltpd %xmm0, %xmm1, %xmm0
; AVX1OR2-NEXT: vpsllq $63, %xmm0, %xmm0
; AVX1OR2-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
; AVX1OR2-NEXT: vtestpd %xmm1, %xmm0
; AVX1OR2-NEXT: movl $42, %ecx
; AVX1OR2-NEXT: movl $99, %eax
; AVX1OR2-NEXT: cmovbl %ecx, %eax
; AVX1OR2-NEXT: retq
;
; KNL-LABEL: PR39665_c_ray_select:
; KNL: # %bb.0:
; KNL-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
; KNL-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
; KNL-NEXT: vcmpltpd %zmm0, %zmm1, %k0
; KNL-NEXT: knotw %k0, %k0
; KNL-NEXT: kmovw %k0, %eax
; KNL-NEXT: testb $3, %al
; KNL-NEXT: movl $42, %ecx
; KNL-NEXT: movl $99, %eax
; KNL-NEXT: cmovel %ecx, %eax
; KNL-NEXT: vzeroupper
; KNL-NEXT: retq
;
; SKX-LABEL: PR39665_c_ray_select:
; SKX: # %bb.0:
; SKX-NEXT: vcmpltpd %xmm0, %xmm1, %k0
; SKX-NEXT: knotw %k0, %k0
; SKX-NEXT: kmovd %k0, %eax
; SKX-NEXT: testb $3, %al
; SKX-NEXT: movl $42, %ecx
; SKX-NEXT: movl $99, %eax
; SKX-NEXT: cmovel %ecx, %eax
; SKX-NEXT: retq
%cmp = fcmp fast ogt <2 x double> %x, %y
%b0 = extractelement <2 x i1> %cmp, i64 0
%b1 = extractelement <2 x i1> %cmp, i64 1
%b = select i1 %b0, i1 %b1, i1 false
%r = select i1 %b, i32 42, i32 99
ret i32 %r
}

define i32 @pr67287(<2 x i64> %broadcast.splatinsert25) {
; SSE2-LABEL: pr67287:
; SSE2: # %bb.0: # %entry
Expand All @@ -4438,10 +4493,10 @@ define i32 @pr67287(<2 x i64> %broadcast.splatinsert25) {
; SSE2-NEXT: movd %xmm1, %ecx
; SSE2-NEXT: orb %al, %cl
; SSE2-NEXT: testb $1, %cl
; SSE2-NEXT: je .LBB97_2
; SSE2-NEXT: je .LBB98_2
; SSE2-NEXT: # %bb.1:
; SSE2-NEXT: movw $0, 0
; SSE2-NEXT: .LBB97_2: # %middle.block
; SSE2-NEXT: .LBB98_2: # %middle.block
; SSE2-NEXT: xorl %eax, %eax
; SSE2-NEXT: retq
;
Expand All @@ -4456,10 +4511,10 @@ define i32 @pr67287(<2 x i64> %broadcast.splatinsert25) {
; SSE41-NEXT: movd %xmm0, %ecx
; SSE41-NEXT: orb %al, %cl
; SSE41-NEXT: testb $1, %cl
; SSE41-NEXT: je .LBB97_2
; SSE41-NEXT: je .LBB98_2
; SSE41-NEXT: # %bb.1:
; SSE41-NEXT: movw $0, 0
; SSE41-NEXT: .LBB97_2: # %middle.block
; SSE41-NEXT: .LBB98_2: # %middle.block
; SSE41-NEXT: xorl %eax, %eax
; SSE41-NEXT: retq
;
Expand All @@ -4473,10 +4528,10 @@ define i32 @pr67287(<2 x i64> %broadcast.splatinsert25) {
; AVX1-NEXT: vmovd %xmm0, %ecx
; AVX1-NEXT: orb %al, %cl
; AVX1-NEXT: testb $1, %cl
; AVX1-NEXT: je .LBB97_2
; AVX1-NEXT: je .LBB98_2
; AVX1-NEXT: # %bb.1:
; AVX1-NEXT: movw $0, 0
; AVX1-NEXT: .LBB97_2: # %middle.block
; AVX1-NEXT: .LBB98_2: # %middle.block
; AVX1-NEXT: xorl %eax, %eax
; AVX1-NEXT: retq
;
Expand All @@ -4490,10 +4545,10 @@ define i32 @pr67287(<2 x i64> %broadcast.splatinsert25) {
; AVX2-NEXT: vmovd %xmm0, %ecx
; AVX2-NEXT: orb %al, %cl
; AVX2-NEXT: testb $1, %cl
; AVX2-NEXT: je .LBB97_2
; AVX2-NEXT: je .LBB98_2
; AVX2-NEXT: # %bb.1:
; AVX2-NEXT: movw $0, 0
; AVX2-NEXT: .LBB97_2: # %middle.block
; AVX2-NEXT: .LBB98_2: # %middle.block
; AVX2-NEXT: xorl %eax, %eax
; AVX2-NEXT: retq
;
Expand All @@ -4508,10 +4563,10 @@ define i32 @pr67287(<2 x i64> %broadcast.splatinsert25) {
; KNL-NEXT: setne %cl
; KNL-NEXT: orb %cl, %al
; KNL-NEXT: testb $1, %al
; KNL-NEXT: je .LBB97_2
; KNL-NEXT: je .LBB98_2
; KNL-NEXT: # %bb.1:
; KNL-NEXT: movw $0, 0
; KNL-NEXT: .LBB97_2: # %middle.block
; KNL-NEXT: .LBB98_2: # %middle.block
; KNL-NEXT: xorl %eax, %eax
; KNL-NEXT: vzeroupper
; KNL-NEXT: retq
Expand All @@ -4526,10 +4581,10 @@ define i32 @pr67287(<2 x i64> %broadcast.splatinsert25) {
; SKX-NEXT: kmovd %k0, %ecx
; SKX-NEXT: orb %al, %cl
; SKX-NEXT: testb $1, %cl
; SKX-NEXT: je .LBB97_2
; SKX-NEXT: je .LBB98_2
; SKX-NEXT: # %bb.1:
; SKX-NEXT: movw $0, 0
; SKX-NEXT: .LBB97_2: # %middle.block
; SKX-NEXT: .LBB98_2: # %middle.block
; SKX-NEXT: xorl %eax, %eax
; SKX-NEXT: retq
entry:
Expand Down

0 comments on commit 6c59dfb

Please sign in to comment.