[llvm] [PowerPC ][NFC] Add a test case for the function atomic_compare_exchange_weak (PR #141263)

Lei Huang via llvm-commits llvm-commits at lists.llvm.org
Mon May 26 13:38:50 PDT 2025


================
@@ -0,0 +1,100 @@
+; Test the generation of asm for the function:
+; int foo(_Atomic int *cp, int *old, int c) {
+;  return atomic_compare_exchange_weak_explicit(cp, old, c, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
+; }  
+
+; RUN: llc < %s -ppc-asm-full-reg-names  -mtriple=powerpc-ibm-aix -mcpu=pwr8  -verify-machineinstrs | FileCheck %s --check-prefix=CHECK
+; RUN: llc < %s -ppc-asm-full-reg-names  -mtriple=powerpc64-ibm-aix -mcpu=pwr8  -verify-machineinstrs | FileCheck %s --check-prefix=CHECK64
----------------
lei137 wrote:

should also use ` -ppc-vsr-nums-as-vr`
Can we auto generate the checks via  `utils/update_llc_test_checks.py`? It would make it easier if things change.  Otherwise we need to better document exactly what is the important part of the code gen that we want to focus on.

https://github.com/llvm/llvm-project/pull/141263


More information about the llvm-commits mailing list