[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
Loading
Please sign in to comment