Skip to content

Commit 5183a13

Browse files
committed
[X86] Add umin knownbits/demandedbits ult test for D94532
1 parent 791634b commit 5183a13

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

llvm/test/CodeGen/X86/combine-umin.ll

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=SSE2
3-
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=SSE41
4-
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=SSE42
5-
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=AVX
6-
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=AVX
7-
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefix=AVX
8-
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw | FileCheck %s --check-prefix=AVX
2+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,SSE2
3+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefixes=CHECK,SSE41
4+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.2 | FileCheck %s --check-prefixes=CHECK,SSE42
5+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=CHECK,AVX
6+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK,AVX
7+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,AVX
8+
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw | FileCheck %s --check-prefixes=CHECK,AVX
9+
10+
define i8 @test_demandedbits_umin_ult(i8 %a0, i8 %a1) {
11+
; CHECK-LABEL: test_demandedbits_umin_ult:
12+
; CHECK: # %bb.0:
13+
; CHECK-NEXT: orb $12, %dil
14+
; CHECK-NEXT: orb $4, %sil
15+
; CHECK-NEXT: andb $13, %dil
16+
; CHECK-NEXT: andb $12, %sil
17+
; CHECK-NEXT: movzbl %dil, %ecx
18+
; CHECK-NEXT: movzbl %sil, %eax
19+
; CHECK-NEXT: cmpb %al, %cl
20+
; CHECK-NEXT: cmovbl %ecx, %eax
21+
; CHECK-NEXT: # kill: def $al killed $al killed $eax
22+
; CHECK-NEXT: retq
23+
%lhs0 = and i8 %a0, 13 ; b1101
24+
%rhs0 = and i8 %a1, 12 ; b1100
25+
%lhs1 = or i8 %lhs0, 12 ; b1100
26+
%rhs1 = or i8 %rhs0, 4 ; b0100
27+
%umin = tail call i8 @llvm.umin.i8(i8 %lhs1, i8 %rhs1)
28+
ret i8 %umin
29+
}
30+
declare i8 @llvm.umin.i8(i8, i8)
931

1032
define <8 x i16> @test_v8i16_nosignbit(<8 x i16> %a, <8 x i16> %b) {
1133
; SSE2-LABEL: test_v8i16_nosignbit:

0 commit comments

Comments
 (0)