aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.h
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-06-14 14:46:08 +0200
committerRichard Biener <rguenther@suse.de>2024-06-18 07:46:13 +0200
commit4b75ed33fa5fd604897e7a30e79bd28d46598373 (patch)
tree4db901ce8166f1df578062ddc2b26282cea719c2 /gcc/tree-ssa-alias.h
parent792ebb073252d2a4cecb0df23b6b702a8c55eec5 (diff)
downloadgcc-4b75ed33fa5fd604897e7a30e79bd28d46598373.zip
gcc-4b75ed33fa5fd604897e7a30e79bd28d46598373.tar.gz
gcc-4b75ed33fa5fd604897e7a30e79bd28d46598373.tar.bz2
Enhance if-conversion for automatic arrays
Automatic arrays that are not address-taken should not be subject to store data races. This applies to OMP SIMD in-branch lowered functions result array which for the testcase otherwise prevents vectorization with SSE and for AVX and AVX512 ends up with spurious .MASK_STORE to the stack surviving. This inefficiency was noted in PR111793. I've introduced ref_can_have_store_data_races, commonizing uses of flag_store_data_races in if-conversion, cselim and store motion. PR tree-optimization/111793 * tree-ssa-alias.h (ref_can_have_store_data_races): Declare. * tree-ssa-alias.cc (ref_can_have_store_data_races): New function. * tree-if-conv.cc (ifcvt_memrefs_wont_trap): Use ref_can_have_store_data_races to allow more unconditional stores. * tree-ssa-loop-im.cc (execute_sm): Likewise. * tree-ssa-phiopt.cc (cond_store_replacement): Likewise. * gcc.dg/vect/vect-simd-clone-21.c: New testcase.
Diffstat (limited to 'gcc/tree-ssa-alias.h')
-rw-r--r--gcc/tree-ssa-alias.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias.h b/gcc/tree-ssa-alias.h
index 5cd64e7..5834533 100644
--- a/gcc/tree-ssa-alias.h
+++ b/gcc/tree-ssa-alias.h
@@ -144,6 +144,8 @@ extern bool call_may_clobber_ref_p (gcall *, tree, bool = true);
extern bool call_may_clobber_ref_p_1 (gcall *, ao_ref *, bool = true);
extern bool stmt_kills_ref_p (gimple *, tree);
extern bool stmt_kills_ref_p (gimple *, ao_ref *);
+extern bool ref_can_have_store_data_races (tree);
+
enum translate_flags
{ TR_TRANSLATE, TR_VALUEIZE_AND_DISAMBIGUATE, TR_DISAMBIGUATE };
extern tree get_continuation_for_phi (gimple *, ao_ref *, bool,