[PATCH] D111734: [HIP] Relax conditions for address space cast in builtin args

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 15 10:41:39 PDT 2021


tra added inline comments.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:6548-6550
+        // Prevent addrspace cast if the parameter has a default address
+        // space, or the argument has a non-default addrspace and the
+        // target addrspaces of the argument and the parameter differ.
----------------
I'd rephrase it in terms of `add ASC if target AS is different`.

`Prevent` assumes that we've already decided to add an ASC, while it is not the case. All we know is that we've got a pointer argument and we are figuring out whether ASC is needed.


================
Comment at: clang/test/SemaCUDA/builtins-unsafe-atomics-gfx90a.cu:3
+// RUN:  -aux-triple x86_64-unknown-linux-gnu -fcuda-is-device %s \
+// RUN:  -o -
+
----------------
You do not want to produce any output. I think `-fsyntax-only -verify` along with `// expected-no-diagnostics` should do the trick. 


================
Comment at: clang/test/SemaCUDA/builtins-unsafe-atomics-gfx90a.cu:8
+
+// CHECK-LABEL: test_ds_atomic_add_f32
+__device__ void test_ds_atomic_add_f32(float *addr, float val) {
----------------
Not needed w/o FileCheck.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111734



More information about the cfe-commits mailing list