]> gcc.gnu.org Git - gcc.git/commit
openmp: Improve expand_omp_atomic_pipeline
authorJakub Jelinek <jakub@redhat.com>
Fri, 3 Sep 2021 07:54:58 +0000 (09:54 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 3 Sep 2021 07:54:58 +0000 (09:54 +0200)
commit090f0d78f194e3cda23fe904016db77ea36c38fa
tree87259b34ec46b2c39b0ff629fc54106acc9d8404
parente902136b310ee17d4b49eb42d9d5e487d5dcf4a1
openmp: Improve expand_omp_atomic_pipeline

When __atomic_* builtins were introduced, omp-expand.c (omp-low.c
at that point) has been adjusted in several spots so that it uses
the atomic builtins instead of sync builtins, but
expand_omp_atomic_pipeline has not because the __atomic_compare_exchange_*
APIs take address of the argument, so it kept using __sync_val_compare_swap_*.
That means it always uses seq_cst though.
This patch changes it to use the ATOMIC_COMPARE_EXCHANGE ifn which gimple-fold
folds __atomic_compare_exchange_* into - that ifn also passes expected
directly.

2021-09-03  Jakub Jelinek  <jakub@redhat.com>

* omp-expand.c (expand_omp_atomic_pipeline): Use
IFN_ATOMIC_COMPARE_EXCHANGE instead of
BUILT_IN_SYNC_VAL_COMPARE_AND_SWAP_? so that memory order
can be provided.
gcc/omp-expand.c
This page took 0.059654 seconds and 5 git commands to generate.