[Patch][OpenCL] Custom atomic Builtin check ignores address space of a non-atomic pointer
Anastasia Stulova via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 21 03:49:27 PDT 2015
Are you ok with this change?
From: cfe-commits [mailto:cfe-commits-bounces at lists.llvm.org] On Behalf Of Anastasia Stulova via cfe-commits
Sent: 12 October 2015 16:00
To: 'Pekka Jääskeläinen'; cfe-commits at lists.llvm.org
Subject: RE: [Patch][OpenCL] Custom atomic Builtin check ignores address space of a non-atomic pointer
I have just made one minor update in the CodeGen test (test/CodeGen/atomic-ops.c) that is now checking the IR output rather than only making sure frontend doesn't crash.
The final patch is attached here!
From: Pekka Jääskeläinen [mailto:pekka.jaaskelainen at tut.fi]
Sent: 02 October 2015 10:20
To: Anastasia Stulova; cfe-commits at lists.llvm.org
Subject: Re: [Patch][OpenCL] Custom atomic Builtin check ignores address space of a non-atomic pointer
Related to it:
There has been so many getPointerTo() issues with multi-AS in the past that I wonder if it'd be time to drop the default value from it, and go through all the places where it's called with the default AS, thus breaking multi-AS. Might be a worthwhile job to do at some point.
On 09/30/2015 01:23 PM, Anastasia Stulova via cfe-commits wrote:
> Hi all,
> Address spaces are not handled in custom semantic checks of atomic Builtins.
> If there are two pointers passed to the Builtin, it doesn't allow the
> (non-atomic) one to be qualified with an address space.
> This patch removed this restriction by recording the address space of
> passed pointers while checking its type correctness.
> Currently, the following code:
> _Atomic int __attribute__((address_space(1))) *A;
> int __attribute__((address_space(2))) *B;
> ... = __c11_atomic_compare_exchange_strong(A, B, 1,
> memory_order_seq_cst, memory_order_seq_cst);
> fails to compile with an error:
> "passing '__attribute__((address_space(2))) int *' to parameter of
> type 'int *' changes address space of pointer".
> Please, review the attached fix for it!
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
More information about the cfe-commits