Skip to content

Commit

Permalink
[NFC][X86] Precommit another testcase for D101944
Browse files Browse the repository at this point in the history
  • Loading branch information
LebedevRI committed May 11, 2021
1 parent dfc1e31 commit 2c1f9f3
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions llvm/test/CodeGen/X86/64-bit-shift-by-32-minus-y.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 2c1f9f3

Please sign in to comment.