[llvm] 2c1f9f3 - [NFC][X86] Precommit another testcase for D101944

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Tue May 11 08:34:58 PDT 2021


Author: Roman Lebedev
Date: 2021-05-11T18:34:43+03:00
New Revision: 2c1f9f390b0a5dd308e2e925fe250d19a29c103f

URL: https://github.com/llvm/llvm-project/commit/2c1f9f390b0a5dd308e2e925fe250d19a29c103f
DIFF: https://github.com/llvm/llvm-project/commit/2c1f9f390b0a5dd308e2e925fe250d19a29c103f.diff

LOG: [NFC][X86] Precommit another testcase for D101944

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/64-bit-shift-by-32-minus-y.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/64-bit-shift-by-32-minus-y.ll b/llvm/test/CodeGen/X86/64-bit-shift-by-32-minus-y.ll
index 87dc69bea030..a69efc6f4f7e 100644
--- a/llvm/test/CodeGen/X86/64-bit-shift-by-32-minus-y.ll
+++ b/llvm/test/CodeGen/X86/64-bit-shift-by-32-minus-y.ll
@@ -365,3 +365,78 @@ define i64 @t5_cse(i64 %val, i64 %shamt, i64*%dst) nounwind {
   %shifted = shl i64 %val, %negshamt
   ret i64 %shifted
 }
+
+define i64 @t6_cse2(i64 %val, i64 %shamt, i64*%dst) nounwind {
+; X64-NOBMI2-LABEL: t6_cse2:
+; X64-NOBMI2:       # %bb.0:
+; X64-NOBMI2-NEXT:    movq %rdi, %rax
+; X64-NOBMI2-NEXT:    movl $32, %ecx
+; X64-NOBMI2-NEXT:    subq %rsi, %rcx
+; X64-NOBMI2-NEXT:    movq %rcx, (%rdx)
+; X64-NOBMI2-NEXT:    # kill: def $cl killed $cl killed $rcx
+; X64-NOBMI2-NEXT:    shlq %cl, %rax
+; X64-NOBMI2-NEXT:    retq
+;
+; X64-BMI2-LABEL: t6_cse2:
+; X64-BMI2:       # %bb.0:
+; X64-BMI2-NEXT:    movl $32, %eax
+; X64-BMI2-NEXT:    subq %rsi, %rax
+; X64-BMI2-NEXT:    movq %rax, (%rdx)
+; X64-BMI2-NEXT:    shlxq %rax, %rdi, %rax
+; X64-BMI2-NEXT:    retq
+;
+; X32-NOBMI2-LABEL: t6_cse2:
+; X32-NOBMI2:       # %bb.0:
+; X32-NOBMI2-NEXT:    pushl %edi
+; X32-NOBMI2-NEXT:    pushl %esi
+; X32-NOBMI2-NEXT:    movl {{[0-9]+}}(%esp), %esi
+; X32-NOBMI2-NEXT:    movl {{[0-9]+}}(%esp), %edx
+; X32-NOBMI2-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X32-NOBMI2-NEXT:    xorl %edi, %edi
+; X32-NOBMI2-NEXT:    movl $32, %ecx
+; X32-NOBMI2-NEXT:    subl {{[0-9]+}}(%esp), %ecx
+; X32-NOBMI2-NEXT:    sbbl {{[0-9]+}}(%esp), %edi
+; X32-NOBMI2-NEXT:    movl %ecx, (%eax)
+; X32-NOBMI2-NEXT:    movl %edi, 4(%eax)
+; X32-NOBMI2-NEXT:    movl %esi, %eax
+; X32-NOBMI2-NEXT:    shll %cl, %eax
+; X32-NOBMI2-NEXT:    shldl %cl, %esi, %edx
+; X32-NOBMI2-NEXT:    testb $32, %cl
+; X32-NOBMI2-NEXT:    je .LBB6_2
+; X32-NOBMI2-NEXT:  # %bb.1:
+; X32-NOBMI2-NEXT:    movl %eax, %edx
+; X32-NOBMI2-NEXT:    xorl %eax, %eax
+; X32-NOBMI2-NEXT:  .LBB6_2:
+; X32-NOBMI2-NEXT:    popl %esi
+; X32-NOBMI2-NEXT:    popl %edi
+; X32-NOBMI2-NEXT:    retl
+;
+; X32-BMI2-LABEL: t6_cse2:
+; X32-BMI2:       # %bb.0:
+; X32-BMI2-NEXT:    pushl %edi
+; X32-BMI2-NEXT:    pushl %esi
+; X32-BMI2-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X32-BMI2-NEXT:    movl {{[0-9]+}}(%esp), %edx
+; X32-BMI2-NEXT:    movl {{[0-9]+}}(%esp), %esi
+; X32-BMI2-NEXT:    xorl %edi, %edi
+; X32-BMI2-NEXT:    movl $32, %ecx
+; X32-BMI2-NEXT:    subl {{[0-9]+}}(%esp), %ecx
+; X32-BMI2-NEXT:    sbbl {{[0-9]+}}(%esp), %edi
+; X32-BMI2-NEXT:    movl %ecx, (%esi)
+; X32-BMI2-NEXT:    movl %edi, 4(%esi)
+; X32-BMI2-NEXT:    shldl %cl, %eax, %edx
+; X32-BMI2-NEXT:    shlxl %ecx, %eax, %eax
+; X32-BMI2-NEXT:    testb $32, %cl
+; X32-BMI2-NEXT:    je .LBB6_2
+; X32-BMI2-NEXT:  # %bb.1:
+; X32-BMI2-NEXT:    movl %eax, %edx
+; X32-BMI2-NEXT:    xorl %eax, %eax
+; X32-BMI2-NEXT:  .LBB6_2:
+; X32-BMI2-NEXT:    popl %esi
+; X32-BMI2-NEXT:    popl %edi
+; X32-BMI2-NEXT:    retl
+  %negshamt = sub i64 32, %shamt
+  store i64 %negshamt, i64* %dst
+  %shifted = shl i64 %val, %negshamt
+  ret i64 %shifted
+}


        


More information about the llvm-commits mailing list