public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-3734] Disable TBAA in some uses of call_may_clobber_ref_p
@ 2020-10-08 15:23 Jan Hubicka
0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2020-10-08 15:23 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:3e1123e52f8eca2650efa0bc81768792d328961f
commit r11-3734-g3e1123e52f8eca2650efa0bc81768792d328961f
Author: Jan Hubicka <jh@suse.cz>
Date: Thu Oct 8 17:15:58 2020 +0200
Disable TBAA in some uses of call_may_clobber_ref_p
* tree-nrv.c (dest_safe_for_nrv_p): Disable tbaa in
call_may_clobber_ref_p and ref_maybe_used_by_stmt_p.
* tree-tailcall.c (find_tail_calls): Likewise.
* tree-ssa-alias.c (call_may_clobber_ref_p): Add tbaa_p parameter.
* tree-ssa-alias.h (call_may_clobber_ref_p): Update prototype.
* tree-ssa-sccvn.c (vn_reference_lookup_3): Pass data->tbaa_p
to call_may_clobber_ref_p_1.
Diff:
---
gcc/tree-nrv.c | 4 ++--
gcc/tree-ssa-alias.c | 4 ++--
gcc/tree-ssa-alias.h | 2 +-
gcc/tree-ssa-sccvn.c | 2 +-
gcc/tree-tailcall.c | 6 +++---
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index 9d17a104f34..df757f70e71 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -315,8 +315,8 @@ dest_safe_for_nrv_p (gcall *call)
if (TREE_CODE (dest) == SSA_NAME)
return true;
- if (call_may_clobber_ref_p (call, dest)
- || ref_maybe_used_by_stmt_p (call, dest))
+ if (call_may_clobber_ref_p (call, dest, false)
+ || ref_maybe_used_by_stmt_p (call, dest, false))
return false;
return true;
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 97255987e79..ac7e020c5e2 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -3320,12 +3320,12 @@ call_may_clobber_ref_p_1 (gcall *call, ao_ref *ref, bool tbaa_p)
return true, otherwise return false. */
bool
-call_may_clobber_ref_p (gcall *call, tree ref)
+call_may_clobber_ref_p (gcall *call, tree ref, bool tbaa_p)
{
bool res;
ao_ref r;
ao_ref_init (&r, ref);
- res = call_may_clobber_ref_p_1 (call, &r, true);
+ res = call_may_clobber_ref_p_1 (call, &r, tbaa_p);
if (res)
++alias_stats.call_may_clobber_ref_p_may_alias;
else
diff --git a/gcc/tree-ssa-alias.h b/gcc/tree-ssa-alias.h
index 1dd02c0ea62..1561ead2941 100644
--- a/gcc/tree-ssa-alias.h
+++ b/gcc/tree-ssa-alias.h
@@ -128,7 +128,7 @@ extern bool ref_maybe_used_by_stmt_p (gimple *, ao_ref *, bool = true);
extern bool stmt_may_clobber_global_p (gimple *);
extern bool stmt_may_clobber_ref_p (gimple *, tree, bool = true);
extern bool stmt_may_clobber_ref_p_1 (gimple *, ao_ref *, bool = true);
-extern bool call_may_clobber_ref_p (gcall *, tree);
+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 *);
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 014b7bdfd01..c139adb6130 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -2586,7 +2586,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_,
if (valueized_anything)
{
bool res = call_may_clobber_ref_p_1 (as_a <gcall *> (def_stmt),
- ref);
+ ref, data->tbaa_p);
for (unsigned i = 0; i < gimple_call_num_args (def_stmt); ++i)
gimple_call_set_arg (def_stmt, i, oldargs[i]);
if (!res)
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index d81e9213460..44643bef5f1 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -523,7 +523,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
tree result_decl = DECL_RESULT (cfun->decl);
if (result_decl
&& may_be_aliased (result_decl)
- && ref_maybe_used_by_stmt_p (call, result_decl))
+ && ref_maybe_used_by_stmt_p (call, result_decl, false))
return;
/* We found the call, check whether it is suitable. */
@@ -597,8 +597,8 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
if (TREE_CODE (var) != PARM_DECL
&& auto_var_in_fn_p (var, cfun->decl)
&& may_be_aliased (var)
- && (ref_maybe_used_by_stmt_p (call, var)
- || call_may_clobber_ref_p (call, var)))
+ && (ref_maybe_used_by_stmt_p (call, var, false)
+ || call_may_clobber_ref_p (call, var, false)))
{
if (!VAR_P (var))
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-08 15:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-08 15:23 [gcc r11-3734] Disable TBAA in some uses of call_may_clobber_ref_p Jan Hubicka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).