From b33aeee3e3766191ba7ffe2f7b60016ba1fddff2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Amaury=20S=C3=A9chet?= Date: Sun, 24 Jul 2022 16:38:58 +0000 Subject: [PATCH] [X86] Autogenerate atomic tests. NFC --- llvm/test/CodeGen/X86/atomic-load-store.ll | 19 +++++++++++++------ llvm/test/CodeGen/X86/atomic-or.ll | 17 ++++++++++++----- llvm/test/CodeGen/X86/atomic-pointer.ll | 21 ++++++++++++--------- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/llvm/test/CodeGen/X86/atomic-load-store.ll b/llvm/test/CodeGen/X86/atomic-load-store.ll index 5f249b2..5bce440 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 9a658d2..11ab47d 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 8312a60..9c2061e 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 -- 2.7.4