[PATCH] D106920: [AIX] Update fetch_and_add type

Jinsong Ji via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 27 15:13:45 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGedbdf8e5b5aa: [AIX] Update fetch_and_add type (authored by jsji).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106920/new/

https://reviews.llvm.org/D106920

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
  clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c


Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
===================================================================
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch.c
@@ -16,7 +16,7 @@
 // CHECK-NEXT:    [[TMP2:%.*]] = atomicrmw add i32* [[A_ADDR]], i32 [[TMP1]] monotonic, align 4
 // CHECK-NEXT:    ret void
 //
-void test_builtin_ppc_fetch_and_add(unsigned int a, unsigned int b) {
+void test_builtin_ppc_fetch_and_add(int a, int b) {
   __fetch_and_add(&a, b);
 }
 
@@ -31,7 +31,7 @@
 // CHECK-NEXT:    [[TMP2:%.*]] = atomicrmw add i64* [[A_ADDR]], i64 [[TMP1]] monotonic, align 8
 // CHECK-NEXT:    ret void
 //
-void test_builtin_ppc_fetch_and_addlp(unsigned long a, unsigned long b) {
+void test_builtin_ppc_fetch_and_addlp(long a, long b) {
   __fetch_and_addlp(&a, b);
 }
 // CHECK-LABEL: @test_builtin_ppc_fetch_and_and(
Index: clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
===================================================================
--- clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
+++ clang/test/CodeGen/builtins-ppc-xlcompat-fetch-error.c
@@ -1,17 +1,18 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
 // REQUIRES: powerpc-registered-target
 // RUN: %clang_cc1 -triple powerpc64-unknown-aix -target-cpu pwr8 \
 // RUN:  -verify %s
 
 void test_builtin_ppc_fetch_and_add2() {
-  volatile int a = 0;
+  volatile unsigned int a = 0;
   unsigned int b = 0;
 
-  __fetch_and_add(&a, b); // expected-warning {{passing 'volatile int *' to parameter of type 'volatile unsigned int *' converts between pointers to integer types with different sign}}
+  __fetch_and_add(&a, b); // expected-warning {{passing 'volatile unsigned int *' to parameter of type 'volatile int *' converts between pointers to integer types with different sign}}
 }
 
 void test_builtin_ppc_fetch_and_addlp() {
-  volatile long a = 0;
+  volatile unsigned long a = 0;
   unsigned long b = 0;
 
-  __fetch_and_addlp(&a, b); // expected-warning {{passing 'volatile long *' to parameter of type 'volatile unsigned long *' converts between pointers to integer types with different sign}}
+  __fetch_and_addlp(&a, b); // expected-warning {{passing 'volatile unsigned long *' to parameter of type 'volatile long *' converts between pointers to integer types with different sign}}
 }
Index: clang/include/clang/Basic/BuiltinsPPC.def
===================================================================
--- clang/include/clang/Basic/BuiltinsPPC.def
+++ clang/include/clang/Basic/BuiltinsPPC.def
@@ -64,8 +64,8 @@
 BUILTIN(__builtin_ppc_fsqrts, "ff", "")
 BUILTIN(__builtin_ppc_compare_and_swap, "iiD*i*i", "")
 BUILTIN(__builtin_ppc_compare_and_swaplp, "iLiD*Li*Li", "")
-BUILTIN(__builtin_ppc_fetch_and_add, "UiUiD*Ui", "")
-BUILTIN(__builtin_ppc_fetch_and_addlp, "ULiULiD*ULi", "")
+BUILTIN(__builtin_ppc_fetch_and_add, "iiD*i", "")
+BUILTIN(__builtin_ppc_fetch_and_addlp, "LiLiD*Li", "")
 BUILTIN(__builtin_ppc_fetch_and_and, "UiUiD*Ui", "")
 BUILTIN(__builtin_ppc_fetch_and_andlp, "ULiULiD*ULi", "")
 BUILTIN(__builtin_ppc_fetch_and_or, "UiUiD*Ui", "")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106920.362199.patch
Type: text/x-patch
Size: 3150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210727/3992a822/attachment.bin>


More information about the cfe-commits mailing list