[all-commits] [llvm/llvm-project] f3fb97: [AArch64] Comprehensive tests for atomic operations

tmatheson-arm via All-commits all-commits at lists.llvm.org
Tue Jan 10 06:02:44 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f3fb973924a9ba3bdd8dfee4dc85337e8b033ab4
      https://github.com/llvm/llvm-project/commit/f3fb973924a9ba3bdd8dfee4dc85337e8b033ab4
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2023-01-10 (Tue, 10 Jan 2023)

  Changed paths:
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-load-lse128.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-load-lse2.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-load-outline_atomics.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-load-rcpc.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-load-rcpc3.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-load-v8_1a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-load-v8a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-store-lse128.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-store-lse2.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-store-outline_atomics.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-store-rcpc.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-store-rcpc3.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-store-v8_1a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-store-v8a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-lse128.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-lse2.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-outline_atomics.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-rcpc.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-rcpc3.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-v8_1a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-atomicrmw-v8a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-lse128.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-lse2.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-outline_atomics.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-rcpc.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-rcpc3.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-v8_1a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-cmpxchg-v8a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64-fence.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-load-lse128.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-load-lse2.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-load-outline_atomics.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-load-rcpc.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-load-rcpc3.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-load-v8_1a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-load-v8a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-store-lse128.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-store-lse2.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-store-outline_atomics.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-store-rcpc.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-store-rcpc3.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-store-v8_1a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomic-store-v8a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomicrmw-lse128.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomicrmw-lse2.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomicrmw-outline_atomics.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomicrmw-rcpc.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomicrmw-rcpc3.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomicrmw-v8_1a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-atomicrmw-v8a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-lse128.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-lse2.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-outline_atomics.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-rcpc.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-rcpc3.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-v8_1a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-cmpxchg-v8a.ll
    A llvm/test/CodeGen/AArch64/Atomics/aarch64_be-fence.ll
    A llvm/test/CodeGen/AArch64/Atomics/generate-tests.py

  Log Message:
  -----------
  [AArch64] Comprehensive tests for atomic operations

There are a lot of variants of atomic operations, and AArch64 has several
distinct options to codegen them, and does different things depending on
available features, architecture version and optimisation level. The current
testing for atomic operations has been added gradually over time and does not
give full coverate.  Given how complex the codegen for atomic operations is, it
is valuable to cover the entire parameter space, i.e. test them all. The
resulting set of tests serve also as a reference for how each is codegened.

In order to keep the test files readable and avoid constant updating for
unrelated codegen changes, the test outputs are filtered to only include the
relevant instructions. This shows for each operation and feature which codegen
approach is taken (e.g. ll/sc loop, atomic instruction, library call).

The following parameter space is tested:
 - feature: +lse, +rcpc, etc
 - optimisation level: O0, O1 (covers GISel and SelectionDAG)
 - atomic instruction: load, store, cmpxchg, atomirmw*
 - size: i8, i16, i32, i64, i128
 - aligned/unaligned accesses
 - endianness: big, little
 - atomic ordering: release, acquire, etc
 - load atomic only: const/non-const
 - cmpxchg only: weak/strong
 - atomicrmw: update operation (add, sub, etc)

Notably not covered:
 - volatility: there should be no difference between volatile/non-volatile
 - atomicrmw fadd/fsub

The files are split by triple, LLVM instruction, and feature. This makes it
easy to diff between features and endianness for a given instruction.

The file that generates the tests is included.

There are 70 test files with an average of 2800 lines each.

Differential Revision: https://reviews.llvm.org/D141064




More information about the All-commits mailing list