Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[X86][GlobalISel] Reorganize shift scalar tests (NFC) #68232

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

e-kud
Copy link
Contributor

@e-kud e-kud commented Oct 4, 2023

Removed duplicated tests from GlobalISel directory

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 4, 2023

@llvm/pr-subscribers-llvm-globalisel

@llvm/pr-subscribers-backend-x86

Changes

Removed duplicated tests from GlobalISel directory


Patch is 41.94 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/68232.diff

4 Files Affected:

  • (removed) llvm/test/CodeGen/X86/GlobalISel/ashr-scalar.ll (-177)
  • (removed) llvm/test/CodeGen/X86/GlobalISel/shl-scalar.ll (-171)
  • (removed) llvm/test/CodeGen/X86/fast-isel-shift.ll (-419)
  • (added) llvm/test/CodeGen/X86/isel-shift.ll (+756)
diff --git a/llvm/test/CodeGen/X86/GlobalISel/ashr-scalar.ll b/llvm/test/CodeGen/X86/GlobalISel/ashr-scalar.ll
deleted file mode 100644
index 28a29cc8fb4122b..000000000000000
--- a/llvm/test/CodeGen/X86/GlobalISel/ashr-scalar.ll
+++ /dev/null
@@ -1,177 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X64
-
-define i64 @test_ashr_i64(i64 %arg1, i64 %arg2) {
-; X64-LABEL: test_ashr_i64:
-; X64:       # %bb.0:
-; X64-NEXT:    movq %rdi, %rax
-; X64-NEXT:    movq %rsi, %rcx
-; X64-NEXT:    # kill: def $cl killed $cl killed $rcx
-; X64-NEXT:    sarq %cl, %rax
-; X64-NEXT:    retq
-  %res = ashr i64 %arg1, %arg2
-  ret i64 %res
-}
-
-define i64 @test_ashr_i64_imm(i64 %arg1) {
-; X64-LABEL: test_ashr_i64_imm:
-; X64:       # %bb.0:
-; X64-NEXT:    movq %rdi, %rax
-; X64-NEXT:    sarq $5, %rax
-; X64-NEXT:    retq
-  %res = ashr i64 %arg1, 5
-  ret i64 %res
-}
-
-define i64 @test_ashr_i64_imm1(i64 %arg1) {
-; X64-LABEL: test_ashr_i64_imm1:
-; X64:       # %bb.0:
-; X64-NEXT:    movq %rdi, %rax
-; X64-NEXT:    sarq %rax
-; X64-NEXT:    retq
-  %res = ashr i64 %arg1, 1
-  ret i64 %res
-}
-
-define i32 @test_ashr_i32(i32 %arg1, i32 %arg2) {
-; X64-LABEL: test_ashr_i32:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    movl %esi, %ecx
-; X64-NEXT:    # kill: def $cl killed $cl killed $ecx
-; X64-NEXT:    sarl %cl, %eax
-; X64-NEXT:    retq
-  %res = ashr i32 %arg1, %arg2
-  ret i32 %res
-}
-
-define i32 @test_ashr_i32_imm(i32 %arg1) {
-; X64-LABEL: test_ashr_i32_imm:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    sarl $5, %eax
-; X64-NEXT:    retq
-  %res = ashr i32 %arg1, 5
-  ret i32 %res
-}
-
-define i32 @test_ashr_i32_imm1(i32 %arg1) {
-; X64-LABEL: test_ashr_i32_imm1:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    sarl %eax
-; X64-NEXT:    retq
-  %res = ashr i32 %arg1, 1
-  ret i32 %res
-}
-
-define i16 @test_ashr_i16(i32 %arg1, i32 %arg2) {
-; X64-LABEL: test_ashr_i16:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    movl %esi, %ecx
-; X64-NEXT:    # kill: def $cl killed $cl killed $ecx
-; X64-NEXT:    sarw %cl, %ax
-; X64-NEXT:    # kill: def $ax killed $ax killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i16
-  %a2 = trunc i32 %arg2 to i16
-  %res = ashr i16 %a, %a2
-  ret i16 %res
-}
-
-define i16 @test_ashr_i16_imm(i32 %arg1) {
-; X64-LABEL: test_ashr_i16_imm:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    sarw $5, %ax
-; X64-NEXT:    # kill: def $ax killed $ax killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i16
-  %res = ashr i16 %a, 5
-  ret i16 %res
-}
-
-define i16 @test_ashr_i16_imm1(i32 %arg1) {
-; X64-LABEL: test_ashr_i16_imm1:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    sarw %ax
-; X64-NEXT:    # kill: def $ax killed $ax killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i16
-  %res = ashr i16 %a, 1
-  ret i16 %res
-}
-
-define i8 @test_ashr_i8(i32 %arg1, i32 %arg2) {
-; X64-LABEL: test_ashr_i8:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    movl %esi, %ecx
-; X64-NEXT:    # kill: def $cl killed $cl killed $ecx
-; X64-NEXT:    sarb %cl, %al
-; X64-NEXT:    # kill: def $al killed $al killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i8
-  %a2 = trunc i32 %arg2 to i8
-  %res = ashr i8 %a, %a2
-  ret i8 %res
-}
-
-define i8 @test_ashr_i8_imm(i32 %arg1) {
-; X64-LABEL: test_ashr_i8_imm:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    sarb $5, %al
-; X64-NEXT:    # kill: def $al killed $al killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i8
-  %res = ashr i8 %a, 5
-  ret i8 %res
-}
-
-define i8 @test_ashr_i8_imm1(i32 %arg1) {
-; X64-LABEL: test_ashr_i8_imm1:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    sarb %al
-; X64-NEXT:    # kill: def $al killed $al killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i8
-  %res = ashr i8 %a, 1
-  ret i8 %res
-}
-
-define i1 @test_ashr_i1(i32 %arg1, i32 %arg2) {
-; X64-LABEL: test_ashr_i1:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    movl %esi, %ecx
-; X64-NEXT:    shlb $7, %al
-; X64-NEXT:    sarb $7, %al
-; X64-NEXT:    andb $1, %cl
-; X64-NEXT:    # kill: def $cl killed $cl killed $ecx
-; X64-NEXT:    sarb %cl, %al
-; X64-NEXT:    # kill: def $al killed $al killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i1
-  %a2 = trunc i32 %arg2 to i1
-  %res = ashr i1 %a, %a2
-  ret i1 %res
-}
-
-define i1 @test_ashr_i1_imm1(i32 %arg1) {
-; X64-LABEL: test_ashr_i1_imm1:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    shlb $7, %al
-; X64-NEXT:    sarb $7, %al
-; X64-NEXT:    movb $1, %cl
-; X64-NEXT:    sarb %cl, %al
-; X64-NEXT:    # kill: def $al killed $al killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i1
-  %res = ashr i1 %a, 1
-  ret i1 %res
-}
diff --git a/llvm/test/CodeGen/X86/GlobalISel/shl-scalar.ll b/llvm/test/CodeGen/X86/GlobalISel/shl-scalar.ll
deleted file mode 100644
index c298ed6d106c7d7..000000000000000
--- a/llvm/test/CodeGen/X86/GlobalISel/shl-scalar.ll
+++ /dev/null
@@ -1,171 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X64
-
-define i64 @test_shl_i64(i64 %arg1, i64 %arg2) {
-; X64-LABEL: test_shl_i64:
-; X64:       # %bb.0:
-; X64-NEXT:    movq %rdi, %rax
-; X64-NEXT:    movq %rsi, %rcx
-; X64-NEXT:    # kill: def $cl killed $cl killed $rcx
-; X64-NEXT:    shlq %cl, %rax
-; X64-NEXT:    retq
-  %res = shl i64 %arg1, %arg2
-  ret i64 %res
-}
-
-define i64 @test_shl_i64_imm(i64 %arg1) {
-; X64-LABEL: test_shl_i64_imm:
-; X64:       # %bb.0:
-; X64-NEXT:    movq %rdi, %rax
-; X64-NEXT:    shlq $5, %rax
-; X64-NEXT:    retq
-  %res = shl i64 %arg1, 5
-  ret i64 %res
-}
-
-define i64 @test_shl_i64_imm1(i64 %arg1) {
-; X64-LABEL: test_shl_i64_imm1:
-; X64:       # %bb.0:
-; X64-NEXT:    leaq (%rdi,%rdi), %rax
-; X64-NEXT:    retq
-  %res = shl i64 %arg1, 1
-  ret i64 %res
-}
-
-define i32 @test_shl_i32(i32 %arg1, i32 %arg2) {
-; X64-LABEL: test_shl_i32:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    movl %esi, %ecx
-; X64-NEXT:    # kill: def $cl killed $cl killed $ecx
-; X64-NEXT:    shll %cl, %eax
-; X64-NEXT:    retq
-  %res = shl i32 %arg1, %arg2
-  ret i32 %res
-}
-
-define i32 @test_shl_i32_imm(i32 %arg1) {
-; X64-LABEL: test_shl_i32_imm:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    shll $5, %eax
-; X64-NEXT:    retq
-  %res = shl i32 %arg1, 5
-  ret i32 %res
-}
-
-define i32 @test_shl_i32_imm1(i32 %arg1) {
-; X64-LABEL: test_shl_i32_imm1:
-; X64:       # %bb.0:
-; X64-NEXT:    # kill: def $edi killed $edi def $rdi
-; X64-NEXT:    leal (%rdi,%rdi), %eax
-; X64-NEXT:    retq
-  %res = shl i32 %arg1, 1
-  ret i32 %res
-}
-
-define i16 @test_shl_i16(i32 %arg1, i32 %arg2) {
-; X64-LABEL: test_shl_i16:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    movl %esi, %ecx
-; X64-NEXT:    # kill: def $cl killed $cl killed $ecx
-; X64-NEXT:    shlw %cl, %ax
-; X64-NEXT:    # kill: def $ax killed $ax killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i16
-  %a2 = trunc i32 %arg2 to i16
-  %res = shl i16 %a, %a2
-  ret i16 %res
-}
-
-define i16 @test_shl_i16_imm(i32 %arg1) {
-; X64-LABEL: test_shl_i16_imm:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    shlw $5, %ax
-; X64-NEXT:    # kill: def $ax killed $ax killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i16
-  %res = shl i16 %a, 5
-  ret i16 %res
-}
-
-define i16 @test_shl_i16_imm1(i32 %arg1) {
-; X64-LABEL: test_shl_i16_imm1:
-; X64:       # %bb.0:
-; X64-NEXT:    # kill: def $edi killed $edi def $rdi
-; X64-NEXT:    leal (%rdi,%rdi), %eax
-; X64-NEXT:    # kill: def $ax killed $ax killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i16
-  %res = shl i16 %a, 1
-  ret i16 %res
-}
-
-define i8 @test_shl_i8(i32 %arg1, i32 %arg2) {
-; X64-LABEL: test_shl_i8:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    movl %esi, %ecx
-; X64-NEXT:    # kill: def $cl killed $cl killed $ecx
-; X64-NEXT:    shlb %cl, %al
-; X64-NEXT:    # kill: def $al killed $al killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i8
-  %a2 = trunc i32 %arg2 to i8
-  %res = shl i8 %a, %a2
-  ret i8 %res
-}
-
-define i8 @test_shl_i8_imm(i32 %arg1) {
-; X64-LABEL: test_shl_i8_imm:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    shlb $5, %al
-; X64-NEXT:    # kill: def $al killed $al killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i8
-  %res = shl i8 %a, 5
-  ret i8 %res
-}
-
-define i8 @test_shl_i8_imm1(i32 %arg1) {
-; X64-LABEL: test_shl_i8_imm1:
-; X64:       # %bb.0:
-; X64-NEXT:    # kill: def $edi killed $edi def $rdi
-; X64-NEXT:    leal (%rdi,%rdi), %eax
-; X64-NEXT:    # kill: def $al killed $al killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i8
-  %res = shl i8 %a, 1
-  ret i8 %res
-}
-
-define i1 @test_shl_i1(i32 %arg1, i32 %arg2) {
-; X64-LABEL: test_shl_i1:
-; X64:       # %bb.0:
-; X64-NEXT:    movl %edi, %eax
-; X64-NEXT:    movl %esi, %ecx
-; X64-NEXT:    andb $1, %cl
-; X64-NEXT:    # kill: def $cl killed $cl killed $ecx
-; X64-NEXT:    shlb %cl, %al
-; X64-NEXT:    # kill: def $al killed $al killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i1
-  %a2 = trunc i32 %arg2 to i1
-  %res = shl i1 %a, %a2
-  ret i1 %res
-}
-
-define i1 @test_shl_i1_imm1(i32 %arg1) {
-; X64-LABEL: test_shl_i1_imm1:
-; X64:       # %bb.0:
-; X64-NEXT:    # kill: def $edi killed $edi def $rdi
-; X64-NEXT:    leal (%rdi,%rdi), %eax
-; X64-NEXT:    # kill: def $al killed $al killed $eax
-; X64-NEXT:    retq
-  %a = trunc i32 %arg1 to i1
-  %res = shl i1 %a, 1
-  ret i1 %res
-}
diff --git a/llvm/test/CodeGen/X86/fast-isel-shift.ll b/llvm/test/CodeGen/X86/fast-isel-shift.ll
deleted file mode 100644
index 34cddfef4dd7c79..000000000000000
--- a/llvm/test/CodeGen/X86/fast-isel-shift.ll
+++ /dev/null
@@ -1,419 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 | FileCheck %s
-
-define i8 @shl_i8(i8 %a, i8 %b) {
-; CHECK-LABEL: shl_i8:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %esi, %ecx
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    ## kill: def $cl killed $cl killed $ecx
-; CHECK-NEXT:    shlb %cl, %al
-; CHECK-NEXT:    ## kill: def $al killed $al killed $eax
-; CHECK-NEXT:    retq
-  %c = shl i8 %a, %b
-  ret i8 %c
-}
-
-define i16 @shl_i16(i16 %a, i16 %b) {
-; CHECK-LABEL: shl_i16:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %esi, %ecx
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    ## kill: def $cx killed $cx killed $ecx
-; CHECK-NEXT:    ## kill: def $cl killed $cx
-; CHECK-NEXT:    shlw %cl, %ax
-; CHECK-NEXT:    ## kill: def $ax killed $ax killed $eax
-; CHECK-NEXT:    retq
-  %c = shl i16 %a, %b
-  ret i16 %c
-}
-
-define i32 @shl_i32(i32 %a, i32 %b) {
-; CHECK-LABEL: shl_i32:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %esi, %ecx
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    ## kill: def $cl killed $ecx
-; CHECK-NEXT:    shll %cl, %eax
-; CHECK-NEXT:    retq
-  %c = shl i32 %a, %b
-  ret i32 %c
-}
-
-define i64 @shl_i64(i64 %a, i64 %b) {
-; CHECK-LABEL: shl_i64:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movq %rsi, %rcx
-; CHECK-NEXT:    movq %rdi, %rax
-; CHECK-NEXT:    ## kill: def $cl killed $rcx
-; CHECK-NEXT:    shlq %cl, %rax
-; CHECK-NEXT:    retq
-  %c = shl i64 %a, %b
-  ret i64 %c
-}
-
-define i8 @lshr_i8(i8 %a, i8 %b) {
-; CHECK-LABEL: lshr_i8:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %esi, %ecx
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    ## kill: def $cl killed $cl killed $ecx
-; CHECK-NEXT:    shrb %cl, %al
-; CHECK-NEXT:    ## kill: def $al killed $al killed $eax
-; CHECK-NEXT:    retq
-  %c = lshr i8 %a, %b
-  ret i8 %c
-}
-
-define i16 @lshr_i16(i16 %a, i16 %b) {
-; CHECK-LABEL: lshr_i16:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %esi, %ecx
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    ## kill: def $cx killed $cx killed $ecx
-; CHECK-NEXT:    ## kill: def $cl killed $cx
-; CHECK-NEXT:    shrw %cl, %ax
-; CHECK-NEXT:    ## kill: def $ax killed $ax killed $eax
-; CHECK-NEXT:    retq
-  %c = lshr i16 %a, %b
-  ret i16 %c
-}
-
-define i32 @lshr_i32(i32 %a, i32 %b) {
-; CHECK-LABEL: lshr_i32:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %esi, %ecx
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    ## kill: def $cl killed $ecx
-; CHECK-NEXT:    shrl %cl, %eax
-; CHECK-NEXT:    retq
-  %c = lshr i32 %a, %b
-  ret i32 %c
-}
-
-define i64 @lshr_i64(i64 %a, i64 %b) {
-; CHECK-LABEL: lshr_i64:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movq %rsi, %rcx
-; CHECK-NEXT:    movq %rdi, %rax
-; CHECK-NEXT:    ## kill: def $cl killed $rcx
-; CHECK-NEXT:    shrq %cl, %rax
-; CHECK-NEXT:    retq
-  %c = lshr i64 %a, %b
-  ret i64 %c
-}
-
-define i8 @ashr_i8(i8 %a, i8 %b) {
-; CHECK-LABEL: ashr_i8:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %esi, %ecx
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    ## kill: def $cl killed $cl killed $ecx
-; CHECK-NEXT:    sarb %cl, %al
-; CHECK-NEXT:    ## kill: def $al killed $al killed $eax
-; CHECK-NEXT:    retq
-  %c = ashr i8 %a, %b
-  ret i8 %c
-}
-
-define i16 @ashr_i16(i16 %a, i16 %b) {
-; CHECK-LABEL: ashr_i16:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %esi, %ecx
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    ## kill: def $cx killed $cx killed $ecx
-; CHECK-NEXT:    ## kill: def $cl killed $cx
-; CHECK-NEXT:    sarw %cl, %ax
-; CHECK-NEXT:    ## kill: def $ax killed $ax killed $eax
-; CHECK-NEXT:    retq
-  %c = ashr i16 %a, %b
-  ret i16 %c
-}
-
-define i32 @ashr_i32(i32 %a, i32 %b) {
-; CHECK-LABEL: ashr_i32:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %esi, %ecx
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    ## kill: def $cl killed $ecx
-; CHECK-NEXT:    sarl %cl, %eax
-; CHECK-NEXT:    retq
-  %c = ashr i32 %a, %b
-  ret i32 %c
-}
-
-define i64 @ashr_i64(i64 %a, i64 %b) {
-; CHECK-LABEL: ashr_i64:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movq %rsi, %rcx
-; CHECK-NEXT:    movq %rdi, %rax
-; CHECK-NEXT:    ## kill: def $cl killed $rcx
-; CHECK-NEXT:    sarq %cl, %rax
-; CHECK-NEXT:    retq
-  %c = ashr i64 %a, %b
-  ret i64 %c
-}
-
-define i8 @shl_imm1_i8(i8 %a) {
-; CHECK-LABEL: shl_imm1_i8:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    ## kill: def $edi killed $edi def $rdi
-; CHECK-NEXT:    leal (,%rdi,2), %eax
-; CHECK-NEXT:    ## kill: def $al killed $al killed $eax
-; CHECK-NEXT:    retq
-  %c = shl i8 %a, 1
-  ret i8 %c
-}
-
-define i16 @shl_imm1_i16(i16 %a) {
-; CHECK-LABEL: shl_imm1_i16:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    ## kill: def $edi killed $edi def $rdi
-; CHECK-NEXT:    leal (,%rdi,2), %eax
-; CHECK-NEXT:    ## kill: def $ax killed $ax killed $eax
-; CHECK-NEXT:    retq
-  %c = shl i16 %a, 1
-  ret i16 %c
-}
-
-define i32 @shl_imm1_i32(i32 %a) {
-; CHECK-LABEL: shl_imm1_i32:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    ## kill: def $edi killed $edi def $rdi
-; CHECK-NEXT:    leal (,%rdi,2), %eax
-; CHECK-NEXT:    retq
-  %c = shl i32 %a, 1
-  ret i32 %c
-}
-
-define i64 @shl_imm1_i64(i64 %a) {
-; CHECK-LABEL: shl_imm1_i64:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    leaq (,%rdi,2), %rax
-; CHECK-NEXT:    retq
-  %c = shl i64 %a, 1
-  ret i64 %c
-}
-
-define i8 @lshr_imm1_i8(i8 %a) {
-; CHECK-LABEL: lshr_imm1_i8:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    shrb %al
-; CHECK-NEXT:    ## kill: def $al killed $al killed $eax
-; CHECK-NEXT:    retq
-  %c = lshr i8 %a, 1
-  ret i8 %c
-}
-
-define i16 @lshr_imm1_i16(i16 %a) {
-; CHECK-LABEL: lshr_imm1_i16:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    shrw %ax
-; CHECK-NEXT:    ## kill: def $ax killed $ax killed $eax
-; CHECK-NEXT:    retq
-  %c = lshr i16 %a, 1
-  ret i16 %c
-}
-
-define i32 @lshr_imm1_i32(i32 %a) {
-; CHECK-LABEL: lshr_imm1_i32:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    shrl %eax
-; CHECK-NEXT:    retq
-  %c = lshr i32 %a, 1
-  ret i32 %c
-}
-
-define i64 @lshr_imm1_i64(i64 %a) {
-; CHECK-LABEL: lshr_imm1_i64:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movq %rdi, %rax
-; CHECK-NEXT:    shrq %rax
-; CHECK-NEXT:    retq
-  %c = lshr i64 %a, 1
-  ret i64 %c
-}
-
-define i8 @ashr_imm1_i8(i8 %a) {
-; CHECK-LABEL: ashr_imm1_i8:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    sarb %al
-; CHECK-NEXT:    ## kill: def $al killed $al killed $eax
-; CHECK-NEXT:    retq
-  %c = ashr i8 %a, 1
-  ret i8 %c
-}
-
-define i16 @ashr_imm1_i16(i16 %a) {
-; CHECK-LABEL: ashr_imm1_i16:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    sarw %ax
-; CHECK-NEXT:    ## kill: def $ax killed $ax killed $eax
-; CHECK-NEXT:    retq
-  %c = ashr i16 %a, 1
-  ret i16 %c
-}
-
-define i32 @ashr_imm1_i32(i32 %a) {
-; CHECK-LABEL: ashr_imm1_i32:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    sarl %eax
-; CHECK-NEXT:    retq
-  %c = ashr i32 %a, 1
-  ret i32 %c
-}
-
-define i64 @ashr_imm1_i64(i64 %a) {
-; CHECK-LABEL: ashr_imm1_i64:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movq %rdi, %rax
-; CHECK-NEXT:    sarq %rax
-; CHECK-NEXT:    retq
-  %c = ashr i64 %a, 1
-  ret i64 %c
-}
-
-define i8 @shl_imm4_i8(i8 %a) {
-; CHECK-LABEL: shl_imm4_i8:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    shlb $4, %al
-; CHECK-NEXT:    ## kill: def $al killed $al killed $eax
-; CHECK-NEXT:    retq
-  %c = shl i8 %a, 4
-  ret i8 %c
-}
-
-define i16 @shl_imm4_i16(i16 %a) {
-; CHECK-LABEL: shl_imm4_i16:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    shlw $4, %ax
-; CHECK-NEXT:    ## kill: def $ax killed $ax killed $eax
-; CHECK-NEXT:    retq
-  %c = shl i16 %a, 4
-  ret i16 %c
-}
-
-define i32 @shl_imm4_i32(i32 %a) {
-; CHECK-LABEL: shl_imm4_i32:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    shll $4, %eax
-; CHECK-NEXT:    retq
-  %c = shl i32 %a, 4
-  ret i32 %c
-}
-
-define i64 @shl_imm4_i64(i64 %a) {
-; CHECK-LABEL: shl_imm4_i64:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movq %rdi, %rax
-; CHECK-NEXT:    shlq $4, %rax
-; CHECK-NEXT:    retq
-  %c = shl i64 %a, 4
-  ret i64 %c
-}
-
-define i8 @lshr_imm4_i8(i8 %a) {
-; CHECK-LABEL: lshr_imm4_i8:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    shrb $4, %al
-; CHECK-NEXT:    ## kill: def $al killed $al killed $eax
-; CHECK-NEXT:    retq
-  %c = lshr i8 %a, 4
-  ret i8 %c
-}
-
-define i16 @lshr_imm4_i16(i16 %a) {
-; CHECK-LABEL: lshr_imm4_i16:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    shrw $4, %ax
-; CHECK-NEXT:    ## kill: def $ax killed $ax killed $eax
-; CHECK-NEXT:    retq
-  %c = lshr i16 %a, 4
-  ret i16 %c
-}
-
-define i32 @lshr_imm4_i32(i32 %a) {
-; CHECK-LABEL: lshr_imm4_i32:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    shrl $4, %eax
-; CHECK-NEXT:    retq
-  %c = lshr i32 %a, 4
-  ret i32 %c
-}
-
-define i64 @lshr_imm4_i64(i64 %a) {
-; CHECK-LABEL: lshr_imm4_i64:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movq %rdi, %rax
-; CHECK-NEXT:    shrq $4, %rax
-; CHECK-NEXT:    retq
-  %c = lshr i64 %a, 4
-  ret i64 %c
-}
-
-define i8 @ashr_imm4_i8(i8 %a) {
-; CHECK-LABEL: ashr_imm4_i8:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    sarb $4, %al
-; CHECK-NEXT:    ## kill: def $al killed $al killed $eax
-; CHECK-NEXT:    retq
-  %c = ashr i8 %a, 4
-  ret i8 %c
-}
-
-define i16 @ashr_imm4_i16(i16 %a) {
-; CHECK-LABEL: ashr_imm4_i16:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    sarw $4, %ax
-; CHECK-NEXT:    ## kill: def $ax killed $ax killed $eax
-; CHECK-NEXT:    retq
-  %c = ashr i16 %a, 4
-  ret i16 %c
-}
-
-define i32 @ashr_imm4_i32(i32 %a) {
-; CHECK-LABEL: ashr_imm4_i32:
-; CHECK:       ## %bb.0:
-; CHECK-NEXT:    movl %edi, %eax
-; CHECK-NEXT:    sarl $4, %eax
-; CHECK-NEXT:    retq
-  %c = ashr i32 %a, 4
-  ret i32 %c...
[truncated]

@e-kud
Copy link
Contributor Author

e-kud commented Oct 4, 2023

Basically, moved llvm/test/CodeGen/X86/fast-isel-shift.ll to llvm/test/CodeGen/X86/isel-shift.ll with checking all three selectors and removed duplicates from llvm/test/CodeGen/X86/GlobalISel.

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s --check-prefixes=COMMON,SDAG
; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 | FileCheck %s --check-prefixes=COMMON,FASTISEL
; RUN: llc < %s -global-isel -global-isel-abort=1 -mtriple=x86_64-apple-darwin10 | FileCheck %s --check-prefixes=COMMON,GISEL
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be safe to add i686 coverage? I'm not sure if all gisel legalization is in place or not.

Copy link
Contributor Author

@e-kud e-kud Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah, there is a problem with G_ICMP and i64 input. Probably it'd look weird: reorganizing shuffle tests with G_ICMP legalization.
Something strange happens with 64 bit shifts on i686, I'll take a closer look.
BTW, do you mean i686 only for GlobalISel or for all of them?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding i686 for all of them - but if GlobalIsel is currently failing, then just the other two (with a TODO to add GlobalISel i686 tests in the future).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tunnel shifts are required to support i64 shifts for i686. I already have the implementation on Phabricator. So there is a todo for now.

Removed duplicated tests from GlobalISel directory
Copy link
Collaborator

@RKSimon RKSimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@e-kud e-kud merged commit cc45503 into llvm:main Oct 24, 2023
2 of 3 checks passed
@e-kud e-kud deleted the gisel-shifts branch October 24, 2023 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants