This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IPA merge: Make salias work after SSA form was built

On 12/28/06, Jan Hubicka <> wrote:
this patch is needed in order to move salias pass after build_ssa.  With
IPA-SSA, I do not want the structure vars to be built for all functions
at once (at least not until this proves to be useful) to conserve memory
usage and also we would need to build new split vars after inlining
functions that contains structure references.  In fact one G++ PR is
fixed by moving salias pass after build_ssa in my tree.

Just as a note, Jan and I talked about this for a while on IRC to figure out what the best thing to do here, and settled on the moving salias. This is because you don't want structure vars built for all functions at once right now because you will end up making structures vars that are for parts of a structure that may not be used by that function, and thus, you've increased the number of live structure vars overall, for no real value.

If we started sharing structure vars between functions for
statics/globals,  we might want to do some before and some after, or

Regtested/bootstrapped with IPA-SSA x86_64, routine bootstrap on
i686-linux and mainline is running, but since the new code is disabled
before SSA it ought to pass (I am keeping this conditional as I guess we
might later want to build SSA structure vars early and update them after
inlining or something, so this functionality seems useful)

Okay, but:


        * tree-ssa-alias.c (create_structure_vars): When run after
        SSA is built, update operands of statements referring to split
Index: tree-ssa-alias.c
*** tree-ssa-alias.c    (revision 120209)
--- tree-ssa-alias.c    (working copy)
*************** create_structure_vars (void)
*** 3188,3193 ****
--- 3188,3230 ----
    htab_delete (used_portions);
    VEC_free (tree, heap, varvec);
+   /* Update SSA operands of statememnts mentioning varibales we split.  */
+   if (gimple_in_ssa_p (cfun))
+     FOR_EACH_BB (bb)
+       {
+       block_stmt_iterator bsi;
+       for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+         {
+           tree stmt = bsi_stmt (bsi);
+           bool update = false;
+           unsigned int i;
+           bitmap_iterator bi;

Throw a blank line here

+           if (STORED_SYMS (stmt))
+              EXECUTE_IF_SET_IN_BITMAP (STORED_SYMS (stmt), 0, i, bi)
+               {
+                 tree sym = referenced_var_lookup (i);
+                 if (get_subvars_for_var (sym))
+                   {
+                     update=true;
+                     break;
+                   }
+               }
and here

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]