public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Handle EAF_DIRECT and EAF_UNUSED of pure calls
@ 2020-11-25 14:13 Jan Hubicka
  2020-11-25 14:30 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Hubicka @ 2020-11-25 14:13 UTC (permalink / raw)
  To: gcc-patches

Hi,
while looking into structalias I noticed that we ignore EAF flags here.
This is pity since we still can apply direct and unused.
This patch simply copies logic from normal call handling. I relaize that
it is bit more expensive by creating callarg and doing transitive
closure there instead of doing one common transitive closure on call use.
I can also scan first if there are both direct and !direct argument and
do this optimization, but it does not seem to affect build times (tested
on spec2k6 gcc LTO build)

lto-boostrapped/regtested x86_64-linux.

Honza

diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index a4832b75436..5f84f7d467f 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -4253,12 +4253,20 @@ handle_pure_call (gcall *stmt, vec<ce_s> *results)
   for (i = 0; i < gimple_call_num_args (stmt); ++i)
     {
       tree arg = gimple_call_arg (stmt, i);
+      int flags = gimple_call_arg_flags (stmt, i);
+
+      if (flags & EAF_UNUSED)
+	continue;
+
       if (!uses)
-	{
-	  uses = get_call_use_vi (stmt);
-	  make_any_offset_constraints (uses);
-	  make_transitive_closure_constraints (uses);
-	}
+	uses = get_call_use_vi (stmt);
+      varinfo_t tem = new_var_info (NULL_TREE, "callarg", true);
+      tem->is_reg_var = true;
+      make_constraint_to (tem->id, arg);
+      make_any_offset_constraints (tem);
+      if (!(flags & EAF_DIRECT))
+	make_transitive_closure_constraints (tem);
+      make_copy_constraint (uses, tem->id);
       make_constraint_to (uses->id, arg);
     }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-30 10:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 14:13 Handle EAF_DIRECT and EAF_UNUSED of pure calls Jan Hubicka
2020-11-25 14:30 ` Richard Biener
2020-11-29 15:37   ` Jan Hubicka
2020-11-30  9:59     ` Richard Biener

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).