[llvm] b33aeee - [X86] Autogenerate atomic tests. NFC
Amaury Séchet via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 24 09:45:50 PDT 2022
Author: Amaury Séchet
Date: 2022-07-24T16:42:34Z
New Revision: b33aeee3e3766191ba7ffe2f7b60016ba1fddff2
URL: https://github.com/llvm/llvm-project/commit/b33aeee3e3766191ba7ffe2f7b60016ba1fddff2
DIFF: https://github.com/llvm/llvm-project/commit/b33aeee3e3766191ba7ffe2f7b60016ba1fddff2.diff
LOG: [X86] Autogenerate atomic tests. NFC
Added:
Modified:
llvm/test/CodeGen/X86/atomic-load-store.ll
llvm/test/CodeGen/X86/atomic-or.ll
llvm/test/CodeGen/X86/atomic-pointer.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/atomic-load-store.ll b/llvm/test/CodeGen/X86/atomic-load-store.ll
index 5f249b272737..5bce4401f7bd 100644
--- a/llvm/test/CodeGen/X86/atomic-load-store.ll
+++ b/llvm/test/CodeGen/X86/atomic-load-store.ll
@@ -1,23 +1,30 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-apple-macosx10.7.0 -verify-machineinstrs | FileCheck %s
; RUN: llc < %s -mtriple=x86_64-apple-macosx10.7.0 -verify-machineinstrs -O0 | FileCheck %s
define void @test1(ptr %ptr, i32 %val1) {
-; CHECK: test1
-; CHECK: xchgl %esi, (%rdi)
+; CHECK-LABEL: test1:
+; CHECK: ## %bb.0:
+; CHECK-NEXT: xchgl %esi, (%rdi)
+; CHECK-NEXT: retq
store atomic i32 %val1, ptr %ptr seq_cst, align 4
ret void
}
define void @test2(ptr %ptr, i32 %val1) {
-; CHECK: test2
-; CHECK: movl %esi, (%rdi)
+; CHECK-LABEL: test2:
+; CHECK: ## %bb.0:
+; CHECK-NEXT: movl %esi, (%rdi)
+; CHECK-NEXT: retq
store atomic i32 %val1, ptr %ptr release, align 4
ret void
}
define i32 @test3(ptr %ptr) {
-; CHECK: test3
-; CHECK: movl (%rdi), %eax
+; CHECK-LABEL: test3:
+; CHECK: ## %bb.0:
+; CHECK-NEXT: movl (%rdi), %eax
+; CHECK-NEXT: retq
%val = load atomic i32, ptr %ptr seq_cst, align 4
ret i32 %val
}
diff --git a/llvm/test/CodeGen/X86/atomic-or.ll b/llvm/test/CodeGen/X86/atomic-or.ll
index 9a658d25acb5..11ab47dd4aad 100644
--- a/llvm/test/CodeGen/X86/atomic-or.ll
+++ b/llvm/test/CodeGen/X86/atomic-or.ll
@@ -1,26 +1,33 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-- -verify-machineinstrs | FileCheck %s
; rdar://9692967
define void @t1(ptr %p, i32 %b) nounwind {
+; CHECK-LABEL: t1:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: movq %rdi, -{{[0-9]+}}(%rsp)
+; CHECK-NEXT: movl $2147483648, %eax # imm = 0x80000000
+; CHECK-NEXT: lock orq %rax, (%rdi)
+; CHECK-NEXT: retq
entry:
%p.addr = alloca ptr, align 8
store ptr %p, ptr %p.addr, align 8
%tmp = load ptr, ptr %p.addr, align 8
-; CHECK-LABEL: t1:
-; CHECK: movl $2147483648, %eax
-; CHECK: lock orq %r{{.*}}, (%r{{.*}})
%0 = atomicrmw or ptr %tmp, i64 2147483648 seq_cst
ret void
}
define void @t2(ptr %p, i32 %b) nounwind {
+; CHECK-LABEL: t2:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: movq %rdi, -{{[0-9]+}}(%rsp)
+; CHECK-NEXT: lock orq $2147483644, (%rdi) # imm = 0x7FFFFFFC
+; CHECK-NEXT: retq
entry:
%p.addr = alloca ptr, align 8
store ptr %p, ptr %p.addr, align 8
%tmp = load ptr, ptr %p.addr, align 8
-; CHECK-LABEL: t2:
-; CHECK: lock orq $2147483644, (%r{{.*}})
%0 = atomicrmw or ptr %tmp, i64 2147483644 seq_cst
ret void
}
diff --git a/llvm/test/CodeGen/X86/atomic-pointer.ll b/llvm/test/CodeGen/X86/atomic-pointer.ll
index 8312a60a55fc..9c2061ef30e3 100644
--- a/llvm/test/CodeGen/X86/atomic-pointer.ll
+++ b/llvm/test/CodeGen/X86/atomic-pointer.ll
@@ -1,21 +1,24 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-none-linux -verify-machineinstrs | FileCheck %s
define ptr @test_atomic_ptr_load(ptr %a0) {
-; CHECK: test_atomic_ptr_load
-; CHECK: movl
-; CHECK: movl
-; CHECK: ret
+; CHECK-LABEL: test_atomic_ptr_load:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
+; CHECK-NEXT: movl (%eax), %eax
+; CHECK-NEXT: retl
entry:
%0 = load atomic ptr, ptr %a0 seq_cst, align 4
ret ptr %0
}
define void @test_atomic_ptr_store(ptr %a0, ptr %a1) {
-; CHECK: test_atomic_ptr_store
-; CHECK: movl
-; CHECK: movl
-; CHECK: xchgl
-; CHECK: ret
+; CHECK-LABEL: test_atomic_ptr_store:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
+; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; CHECK-NEXT: xchgl %ecx, (%eax)
+; CHECK-NEXT: retl
entry:
store atomic ptr %a0, ptr %a1 seq_cst, align 4
ret void
More information about the llvm-commits
mailing list