alias.c: Clarify some comments.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Sat, 20 May 2000 16:03:41 +0000 (16:03 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 20 May 2000 16:03:41 +0000 (12:03 -0400)
* alias.c: Clarify some comments.
(record_base_value): REGNO is unsigned.
* rtl.h (record_base_value): Likewise.

From-SVN: r34051

gcc/ChangeLog
gcc/alias.c
gcc/rtl.h

index 6f8d3966b79c3afe736395c6a1e957487e9f9ac1..18e8dfb67870e4ddcfad64723fc3d42b0fca947b 100644 (file)
@@ -1,5 +1,9 @@
 Sat May 20 09:30:55 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
+       * alias.c: Clarify some comments.
+       (record_base_value): REGNO is unsigned.
+       * rtl.h (record_base_value): Likewise.
+
        * alias.c (aliases_everything_p): Don't special-case QImode here.
        * c-common.c (c_get_alias_set): Do it here.
        Handle BIT_FIELD_REF by getting alias info for arg.
index 897c27d08afa33c30b496ce1b035048f3abb8394..2f0392b83889a85d059fc8ec97161eed91d3d245 100644 (file)
@@ -38,8 +38,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* The alias sets assigned to MEMs assist the back-end in determining
    which MEMs can alias which other MEMs.  In general, two MEMs in
-   different alias sets to not alias each other.  There is one
-   exception, however.  Consider something like:
+   different alias sets cannot alias each other, with one important
+   exception.  Consider something like:
 
      struct S {int i; double d; };
 
@@ -53,12 +53,14 @@ Boston, MA 02111-1307, USA.  */
          |/_     _\|
          int    double
 
-   (The arrows are directed and point downwards.)  If, when comparing
-   two alias sets, we can hold one set fixed,  trace the other set
-   downwards, and at some point find the first set, the two MEMs can
-   alias one another.  In this situation we say the alias set for
-   `struct S' is the `superset' and that those for `int' and `double'
-   are `subsets'.  
+   (The arrows are directed and point downwards.)
+    In this situation we say the alias set for `struct S' is the
+   `superset' and that those for `int' and `double' are `subsets'.
+
+   To see whether two alias sets can point to the same memory, we must go
+   down the list of decendents of each and see if there is some alias set
+   in common.  We need not trace past immediate decendents, however, since
+   we propagate all grandchildren up one level.
 
    Alias set zero is implicitly a superset of all other alias sets.
    However, this is no actual entry for alias set zero.  It is an
@@ -70,7 +72,7 @@ typedef struct alias_set_entry
   int alias_set;
 
   /* The children of the alias set.  These are not just the immediate
-     children, but, in fact, all children.  So, if we have:
+     children, but, in fact, all decendents.  So, if we have:
 
        struct T { struct S s; float f; } 
 
@@ -111,9 +113,7 @@ static int nonlocal_reference_p         PARAMS ((rtx));
   mems_in_disjoint_alias_sets_p (MEM1, MEM2)
 
 /* Cap the number of passes we make over the insns propagating alias
-   information through set chains.
-
-   10 is a completely arbitrary choice.  */
+   information through set chains.   10 is a completely arbitrary choice.  */
 #define MAX_ALIAS_LOOP_PASSES 10
    
 /* reg_base_value[N] gives an address to which register N is related.
@@ -164,25 +164,24 @@ static unsigned int reg_known_value_size;
 /* Vector recording for each reg_known_value whether it is due to a
    REG_EQUIV note.  Future passes (viz., reload) may replace the
    pseudo with the equivalent expression and so we account for the
-   dependences that would be introduced if that happens. */
-/* ??? This is a problem only on the Convex.  The REG_EQUIV notes created in
-   assign_parms mention the arg pointer, and there are explicit insns in the
-   RTL that modify the arg pointer.  Thus we must ensure that such insns don't
-   get scheduled across each other because that would invalidate the REG_EQUIV
-   notes.  One could argue that the REG_EQUIV notes are wrong, but solving
-   the problem in the scheduler will likely give better code, so we do it
-   here.  */
+   dependences that would be introduced if that happens.
+
+   The REG_EQUIV notes created in assign_parms may mention the arg
+   pointer, and there are explicit insns in the RTL that modify the
+   arg pointer.  Thus we must ensure that such insns don't get
+   scheduled across each other because that would invalidate the
+   REG_EQUIV notes.  One could argue that the REG_EQUIV notes are
+   wrong, but solving the problem in the scheduler will likely give
+   better code, so we do it here.  */
 char *reg_known_equiv_p;
 
 /* True when scanning insns from the start of the rtl to the
    NOTE_INSN_FUNCTION_BEG note.  */
-
 static int copying_arguments;
 
 /* The splay-tree used to store the various alias set entries.  */
-
 static splay_tree alias_sets;
-
+\f
 /* Returns a pointer to the alias set entry for ALIAS_SET, if there is
    such an entry, or NULL otherwise.  */
 
@@ -196,8 +195,8 @@ get_alias_set_entry (alias_set)
   return sn != 0 ? ((alias_set_entry) sn->value) : 0;
 }
 
-/* Returns nonzero value if the alias sets for MEM1 and MEM2 are such
-   that the two MEMs cannot alias each other.  */
+/* Returns nonzero if the alias sets for MEM1 and MEM2 are such that
+   the two MEMs cannot alias each other.  */
 
 static int 
 mems_in_disjoint_alias_sets_p (mem1, mem2)
@@ -515,26 +514,27 @@ record_set (dest, set, data)
   reg_seen[regno] = 1;
 }
 
-/* Called from loop optimization when a new pseudo-register is created.  */
+/* Called from loop optimization when a new pseudo-register is
+   created.  It indicates that REGNO is being set to VAL.  f INVARIANT
+   is true then this value also describes an invariant relationship
+   which can be used to deduce that two registers with unknown values
+   are different.  */
 
 void
 record_base_value (regno, val, invariant)
-     int regno;
+     unsigned int regno;
      rtx val;
      int invariant;
 {
-  if ((unsigned) regno >= reg_base_value_size)
+  if (regno >= reg_base_value_size)
     return;
 
-  /* If INVARIANT is true then this value also describes an invariant
-     relationship which can be used to deduce that two registers with
-     unknown values are different.  */
   if (invariant && alias_invariant)
     alias_invariant[regno] = val;
 
   if (GET_CODE (val) == REG)
     {
-      if ((unsigned) REGNO (val) < reg_base_value_size)
+      if (REGNO (val) < reg_base_value_size)
        reg_base_value[regno] = reg_base_value[REGNO (val)];
 
       return;
index 853fd391d2a2c69021b6bee1b23ad97c22260132..2de4b0ed300613de479bde5bda151b9fb465cc24 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1823,7 +1823,7 @@ extern void init_alias_once               PARAMS ((void));
 extern void init_alias_analysis                PARAMS ((void));
 extern void end_alias_analysis         PARAMS ((void));
 
-extern void record_base_value          PARAMS ((int, rtx, int));
+extern void record_base_value          PARAMS ((unsigned int, rtx, int));
 extern void record_alias_subset         PARAMS ((int, int));
 extern rtx addr_side_effect_eval       PARAMS ((rtx, int, int));