[llvm] 250620a - [X86] Precommit a test

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 00:01:50 PST 2023


Author: Kazu Hirata
Date: 2023-02-21T00:01:43-08:00
New Revision: 250620ab19d667ea1e03f53dc185ce19202e761d

URL: https://github.com/llvm/llvm-project/commit/250620ab19d667ea1e03f53dc185ce19202e761d
DIFF: https://github.com/llvm/llvm-project/commit/250620ab19d667ea1e03f53dc185ce19202e761d.diff

LOG: [X86] Precommit a test

This patch precommits a test for:

https://github.com/llvm/llvm-project/issues/60374

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/umax.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/umax.ll b/llvm/test/CodeGen/X86/umax.ll
index 2d16dcff1274..ca5ea3a1c7ff 100644
--- a/llvm/test/CodeGen/X86/umax.ll
+++ b/llvm/test/CodeGen/X86/umax.ll
@@ -104,6 +104,25 @@ define i32 @test_i32(i32 %a, i32 %b) nounwind {
   ret i32 %r
 }
 
+define i32 @test_i32_1(i32 %a) nounwind {
+; X64-LABEL: test_i32_1:
+; X64:       # %bb.0:
+; X64-NEXT:    cmpl $2, %edi
+; X64-NEXT:    movl $1, %eax
+; X64-NEXT:    cmovael %edi, %eax
+; X64-NEXT:    retq
+;
+; X86-LABEL: test_i32_1:
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT:    cmpl $2, %ecx
+; X86-NEXT:    movl $1, %eax
+; X86-NEXT:    cmovael %ecx, %eax
+; X86-NEXT:    retl
+  %r = call i32 @llvm.umax.i32(i32 %a, i32 1)
+  ret i32 %r
+}
+
 define i64 @test_i64(i64 %a, i64 %b) nounwind {
 ; X64-LABEL: test_i64:
 ; X64:       # %bb.0:
@@ -134,6 +153,32 @@ define i64 @test_i64(i64 %a, i64 %b) nounwind {
   ret i64 %r
 }
 
+define i64 @test_i64_1(i64 %a) nounwind {
+; X64-LABEL: test_i64_1:
+; X64:       # %bb.0:
+; X64-NEXT:    cmpq $2, %rdi
+; X64-NEXT:    movl $1, %eax
+; X64-NEXT:    cmovaeq %rdi, %rax
+; X64-NEXT:    retq
+;
+; X86-LABEL: test_i64_1:
+; X86:       # %bb.0:
+; X86-NEXT:    pushl %esi
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx
+; X86-NEXT:    cmpl $2, %ecx
+; X86-NEXT:    movl $1, %eax
+; X86-NEXT:    movl $1, %esi
+; X86-NEXT:    cmovael %ecx, %esi
+; X86-NEXT:    testl %edx, %edx
+; X86-NEXT:    cmovnel %ecx, %eax
+; X86-NEXT:    cmovel %esi, %eax
+; X86-NEXT:    popl %esi
+; X86-NEXT:    retl
+  %r = call i64 @llvm.umax.i64(i64 %a, i64 1)
+  ret i64 %r
+}
+
 define i128 @test_i128(i128 %a, i128 %b) nounwind {
 ; X64-LABEL: test_i128:
 ; X64:       # %bb.0:


        


More information about the llvm-commits mailing list