diff options
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r-- | gcc/gimple.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h index 479a1c7..303623b 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -194,8 +194,9 @@ enum gf_mask { GF_OMP_RETURN_NOWAIT = 1 << 0, GF_OMP_SECTION_LAST = 1 << 0, - GF_OMP_ATOMIC_MEMORY_ORDER = (1 << 3) - 1, - GF_OMP_ATOMIC_NEED_VALUE = 1 << 3, + GF_OMP_ATOMIC_MEMORY_ORDER = (1 << 6) - 1, + GF_OMP_ATOMIC_NEED_VALUE = 1 << 6, + GF_OMP_ATOMIC_WEAK = 1 << 7, GF_PREDICT_TAKEN = 1 << 15 }; @@ -2446,6 +2447,29 @@ gimple_omp_atomic_set_need_value (gimple *g) } +/* Return true if OMP atomic load/store statement G has the + GF_OMP_ATOMIC_WEAK flag set. */ + +static inline bool +gimple_omp_atomic_weak_p (const gimple *g) +{ + if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD) + GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE); + return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_WEAK) != 0; +} + + +/* Set the GF_OMP_ATOMIC_WEAK flag on G. */ + +static inline void +gimple_omp_atomic_set_weak (gimple *g) +{ + if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD) + GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE); + g->subcode |= GF_OMP_ATOMIC_WEAK; +} + + /* Return the memory order of the OMP atomic load/store statement G. */ static inline enum omp_memory_order |