]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR ipa/60243 (IPA is slow on large cgraph tree)
authorRichard Biener <rguenther@suse.de>
Wed, 19 Feb 2014 09:29:34 +0000 (09:29 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 19 Feb 2014 09:29:34 +0000 (09:29 +0000)
2014-02-19  Richard Biener  <rguenther@suse.de>

PR ipa/60243
* ipa-prop.c: Include stringpool.h and tree-ssanames.h.
(ipa_modify_call_arguments): Emit an argument load explicitely and
preserve virtual SSA form there and for the replacement call.
Do not update SSA form nor free dominance info.

From-SVN: r207879

gcc/ChangeLog
gcc/ipa-prop.c

index ef48361396560f84a7d867621c788908fe2e54a5..fa67c9e17ff8d33f21e6b0d5cd58b870b37896e1 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-19  Richard Biener  <rguenther@suse.de>
+
+       PR ipa/60243
+       * ipa-prop.c: Include stringpool.h and tree-ssanames.h.
+       (ipa_modify_call_arguments): Emit an argument load explicitely and
+       preserve virtual SSA form there and for the replacement call.
+       Do not update SSA form nor free dominance info.
+
 2014-02-18  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa.c (function_and_variable_visibility): Also clear WEAK
index 133bfc0b7d8a304f90267a4f5d96da565327a782..368b93b7d4ac9161893fa1a8ba14511b6a471746 100644 (file)
@@ -57,6 +57,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-streamer.h"
 #include "params.h"
 #include "ipa-utils.h"
+#include "stringpool.h"
+#include "tree-ssanames.h"
 
 /* Intermediate information about a parameter that is only useful during the
    run of ipa_analyze_node and is not kept afterwards.  */
@@ -3794,18 +3796,32 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
                align = (misalign & -misalign);
              if (align < TYPE_ALIGN (type))
                type = build_aligned_type (type, align);
+             base = force_gimple_operand_gsi (&gsi, base,
+                                              true, NULL, true, GSI_SAME_STMT);
              expr = fold_build2_loc (loc, MEM_REF, type, base, off);
+             /* If expr is not a valid gimple call argument emit
+                a load into a temporary.  */
+             if (is_gimple_reg_type (TREE_TYPE (expr)))
+               {
+                 gimple tem = gimple_build_assign (NULL_TREE, expr);
+                 if (gimple_in_ssa_p (cfun))
+                   {
+                     gimple_set_vuse (tem, gimple_vuse (stmt));
+                     expr = make_ssa_name (TREE_TYPE (expr), tem);
+                   }
+                 else
+                   expr = create_tmp_reg (TREE_TYPE (expr), NULL);
+                 gimple_assign_set_lhs (tem, expr);
+                 gsi_insert_before (&gsi, tem, GSI_SAME_STMT);
+               }
            }
          else
            {
              expr = fold_build2_loc (loc, MEM_REF, adj->type, base, off);
              expr = build_fold_addr_expr (expr);
+             expr = force_gimple_operand_gsi (&gsi, expr,
+                                              true, NULL, true, GSI_SAME_STMT);
            }
-
-         expr = force_gimple_operand_gsi (&gsi, expr,
-                                          adj->by_ref
-                                          || is_gimple_reg_type (adj->type),
-                                          NULL, true, GSI_SAME_STMT);
          vargs.quick_push (expr);
        }
       if (adj->op != IPA_PARM_OP_COPY && MAY_HAVE_DEBUG_STMTS)
@@ -3861,6 +3877,15 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
     gimple_set_location (new_stmt, gimple_location (stmt));
   gimple_call_set_chain (new_stmt, gimple_call_chain (stmt));
   gimple_call_copy_flags (new_stmt, stmt);
+  if (gimple_in_ssa_p (cfun))
+    {
+      gimple_set_vuse (new_stmt, gimple_vuse (stmt));
+      if (gimple_vdef (stmt))
+       {
+         gimple_set_vdef (new_stmt, gimple_vdef (stmt));
+         SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
+       }
+    }
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
@@ -3878,9 +3903,6 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt,
     }
   while ((gsi_end_p (prev_gsi) && !gsi_end_p (gsi))
         || (!gsi_end_p (prev_gsi) && gsi_stmt (gsi) == gsi_stmt (prev_gsi)));
-
-  update_ssa (TODO_update_ssa);
-  free_dominance_info (CDI_DOMINATORS);
 }
 
 /* If the expression *EXPR should be replaced by a reduction of a parameter, do