/* 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; };
|/_ _\|
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
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; }
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.
/* 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. */
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)
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;