[PATCH] D104837: [PowerPC] Add XL compat __compare_and_swap builtins
wael yehia via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 24 17:19:48 PDT 2021
w2yehia accepted this revision.
w2yehia added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang/test/CodeGen/builtins-ppc-xlcompat-cas.c:19
+// CHECK-NEXT: [[TMP2:%.*]] = cmpxchg weak volatile i32* [[A]], i32 [[TMP1]], i32 [[TMP0]] monotonic monotonic, align 4
+// CHECK-NEXT: [[TMP3:%.*]] = extractvalue { i32, i1 } [[TMP2]], 0
+// CHECK-NEXT: [[TMP4:%.*]] = extractvalue { i32, i1 } [[TMP2]], 1
----------------
i dont think we need to check for the extractvalue instructions, they can be optimized away in theory.
================
Comment at: clang/test/CodeGen/builtins-ppc-xlcompat-cas.c:24
+void test_builtin_ppc_compare_and_swap() {
+ volatile int a = 0;
+ int b = 0, c = 0;
----------------
just an FYI that a volatile could have been avoided if the arguments to __compare_and_swap where function parameters
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104837/new/
https://reviews.llvm.org/D104837
More information about the cfe-commits
mailing list