[llvm] 1c378d2 - [X86] Add test for issue 108722; NFC

Noah Goldstein via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 15 16:15:18 PDT 2024


Author: Noah Goldstein
Date: 2024-09-15T16:15:05-07:00
New Revision: 1c378d2b145578948942512f9d6985e37659d013

URL: https://github.com/llvm/llvm-project/commit/1c378d2b145578948942512f9d6985e37659d013
DIFF: https://github.com/llvm/llvm-project/commit/1c378d2b145578948942512f9d6985e37659d013.diff

LOG: [X86] Add test for issue 108722; NFC

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/cmp-shiftX-maskX.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/cmp-shiftX-maskX.ll b/llvm/test/CodeGen/X86/cmp-shiftX-maskX.ll
index 67070b989786db..799b5417857575 100644
--- a/llvm/test/CodeGen/X86/cmp-shiftX-maskX.ll
+++ b/llvm/test/CodeGen/X86/cmp-shiftX-maskX.ll
@@ -994,6 +994,30 @@ define i1 @shr_to_rotate_eq_i32_s5(i32 %x) {
   ret i1 %r
 }
 
+define i32 @issue108722(i32 %0) {
+; CHECK-NOBMI-LABEL: issue108722:
+; CHECK-NOBMI:       # %bb.0:
+; CHECK-NOBMI-NEXT:    movzbl %dil, %ecx
+; CHECK-NOBMI-NEXT:    shrl $24, %edi
+; CHECK-NOBMI-NEXT:    xorl %eax, %eax
+; CHECK-NOBMI-NEXT:    cmpl %edi, %ecx
+; CHECK-NOBMI-NEXT:    sete %al
+; CHECK-NOBMI-NEXT:    retq
+;
+; CHECK-BMI2-LABEL: issue108722:
+; CHECK-BMI2:       # %bb.0:
+; CHECK-BMI2-NEXT:    rorxl $8, %edi, %ecx
+; CHECK-BMI2-NEXT:    xorl %eax, %eax
+; CHECK-BMI2-NEXT:    cmpl %edi, %ecx
+; CHECK-BMI2-NEXT:    sete %al
+; CHECK-BMI2-NEXT:    retq
+  %2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 24)
+  %3 = icmp eq i32 %2, %0
+  %4 = zext i1 %3 to i32
+  ret i32 %4
+}
+
+
 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
 ; CHECK-AVX: {{.*}}
 ; CHECK-NOBMI-SSE2: {{.*}}


        


More information about the llvm-commits mailing list