[llvm] 0dcc653 - [X86] Add combine tests for pointers of mixed sizes (NFC) (#68219)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 4 07:31:28 PDT 2023
Author: Evgenii Kudriashov
Date: 2023-10-04T16:31:24+02:00
New Revision: 0dcc65359b3d7c9725144bc58599faacf2ab2d88
URL: https://github.com/llvm/llvm-project/commit/0dcc65359b3d7c9725144bc58599faacf2ab2d88
DIFF: https://github.com/llvm/llvm-project/commit/0dcc65359b3d7c9725144bc58599faacf2ab2d88.diff
LOG: [X86] Add combine tests for pointers of mixed sizes (NFC) (#68219)
Precommit for #67168 to solve #66873
Added:
Modified:
llvm/test/CodeGen/X86/mixed-ptr-sizes-i686.ll
llvm/test/CodeGen/X86/mixed-ptr-sizes.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/mixed-ptr-sizes-i686.ll b/llvm/test/CodeGen/X86/mixed-ptr-sizes-i686.ll
index 0817211f50937ed..c997d314a50ae4c 100644
--- a/llvm/test/CodeGen/X86/mixed-ptr-sizes-i686.ll
+++ b/llvm/test/CodeGen/X86/mixed-ptr-sizes-i686.ll
@@ -341,3 +341,39 @@ entry:
store i32 %i, ptr addrspace(272) %s, align 8
ret void
}
+
+define i64 @test_load_sptr32_zext_i64(ptr addrspace(270) %i) {
+; ALL-LABEL: test_load_sptr32_zext_i64:
+; ALL: # %bb.0: # %entry
+; ALL-NEXT: movl {{[0-9]+}}(%esp), %eax
+; ALL-NEXT: movl (%eax), %eax
+; ALL-NEXT: xorl %edx, %edx
+; ALL-NEXT: retl
+entry:
+ %0 = load i32, ptr addrspace(270) %i, align 4
+ %1 = zext i32 %0 to i64
+ ret i64 %1
+}
+
+define void @test_store_sptr32_trunc_i1(ptr addrspace(270) %s, i32 %i) {
+; CHECK-LABEL: test_store_sptr32_trunc_i1:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
+; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; CHECK-NEXT: andl $1, %ecx
+; CHECK-NEXT: movb %cl, (%eax)
+; CHECK-NEXT: retl
+;
+; CHECK-O0-LABEL: test_store_sptr32_trunc_i1:
+; CHECK-O0: # %bb.0: # %entry
+; CHECK-O0-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; CHECK-O0-NEXT: movl {{[0-9]+}}(%esp), %eax
+; CHECK-O0-NEXT: andl $1, %ecx
+; CHECK-O0-NEXT: # kill: def $cl killed $cl killed $ecx
+; CHECK-O0-NEXT: movb %cl, (%eax)
+; CHECK-O0-NEXT: retl
+entry:
+ %0 = trunc i32 %i to i1
+ store i1 %0, ptr addrspace(270) %s
+ ret void
+}
diff --git a/llvm/test/CodeGen/X86/mixed-ptr-sizes.ll b/llvm/test/CodeGen/X86/mixed-ptr-sizes.ll
index e88a494908701d8..2dd6011f36b775f 100644
--- a/llvm/test/CodeGen/X86/mixed-ptr-sizes.ll
+++ b/llvm/test/CodeGen/X86/mixed-ptr-sizes.ll
@@ -256,3 +256,35 @@ entry:
store i32 %i, ptr addrspace(272) %s, align 8
ret void
}
+
+define i64 @test_load_sptr32_zext_i64(ptr addrspace(270) %i) {
+; CHECK-LABEL: test_load_sptr32_zext_i64:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: movslq %ecx, %rax
+; CHECK-NEXT: movq (%rax), %rax
+; CHECK-NEXT: retq
+;
+; CHECK-O0-LABEL: test_load_sptr32_zext_i64:
+; CHECK-O0: # %bb.0: # %entry
+; CHECK-O0-NEXT: movslq %ecx, %rax
+; CHECK-O0-NEXT: movl (%rax), %eax
+; CHECK-O0-NEXT: movl %eax, %eax
+; CHECK-O0-NEXT: # kill: def $rax killed $eax
+; CHECK-O0-NEXT: retq
+entry:
+ %0 = load i32, ptr addrspace(270) %i, align 4
+ %1 = zext i32 %0 to i64
+ ret i64 %1
+}
+
+define void @test_store_sptr32_trunc_i1(ptr addrspace(270) %s, i32 %i) {
+; ALL-LABEL: test_store_sptr32_trunc_i1:
+; ALL: # %bb.0: # %entry
+; ALL-NEXT: movslq %ecx, %rax
+; ALL-NEXT: movl %edx, (%rax)
+; ALL-NEXT: retq
+entry:
+ %0 = trunc i32 %i to i1
+ store i1 %0, ptr addrspace(270) %s
+ ret void
+}
More information about the llvm-commits
mailing list