aboutsummaryrefslogtreecommitdiff
path: root/gcc/cselib.h
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2011-12-31 20:02:48 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2011-12-31 20:02:48 +0000
commit6f2ffb4b99ccfb64adc0edc9998329ee9de32eff (patch)
tree3e772ea68b4b52431218cb73789aabb374b906b9 /gcc/cselib.h
parent32210fd616cd79ae540b9731e7efa9288ccc0b87 (diff)
downloadgcc-6f2ffb4b99ccfb64adc0edc9998329ee9de32eff.zip
gcc-6f2ffb4b99ccfb64adc0edc9998329ee9de32eff.tar.gz
gcc-6f2ffb4b99ccfb64adc0edc9998329ee9de32eff.tar.bz2
cselib.h (cselib_add_permanent_equiv): Declare.
* cselib.h (cselib_add_permanent_equiv): Declare. (canonical_cselib_val): New. * cselib.c (new_elt_loc_list): Rework to support value equivalences. Adjust all callers. (preserve_only_constants): Retain value equivalences. (references_value_p): Retain preserved values. (rtx_equal_for_cselib_1): Handle value equivalences. (cselib_invalidate_regno): Use canonical value. (cselib_add_permanent_equiv): New. * alias.c (find_base_term): Reset locs lists while recursing. * var-tracking.c (val_bind): New. Don't add equivalences present in cselib table, compared with code moved from... (val_store): ... here. (val_resolve): Use val_bind. (VAL_EXPR_HAS_REVERSE): Drop. (add_uses): Do not create MOps for addresses. Do not mark non-REG non-MEM expressions as requiring resolution. (reverse_op): Record reverse as a cselib equivalence. (add_stores): Use it. Do not create MOps for addresses. Do not require resolution for non-REG non-MEM expressions. Simplify support for reverse operations. (compute_bb_dataflow): Drop reverse support. (emit_notes_in_bb): Likewise. (create_entry_value): Rename to... (record_entry_value): ... this. Use cselib equivalences. (vt_add_function_parameter): Adjust. From-SVN: r182760
Diffstat (limited to 'gcc/cselib.h')
-rw-r--r--gcc/cselib.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/cselib.h b/gcc/cselib.h
index 3590f98..6a9d795 100644
--- a/gcc/cselib.h
+++ b/gcc/cselib.h
@@ -96,5 +96,24 @@ extern void cselib_preserve_value (cselib_val *);
extern bool cselib_preserved_value_p (cselib_val *);
extern void cselib_preserve_only_values (void);
extern void cselib_preserve_cfa_base_value (cselib_val *, unsigned int);
+extern void cselib_add_permanent_equiv (cselib_val *, rtx, rtx);
extern void dump_cselib_table (FILE *);
+
+/* Return the canonical value for VAL, following the equivalence chain
+ towards the earliest (== lowest uid) equivalent value. */
+
+static inline cselib_val *
+canonical_cselib_val (cselib_val *val)
+{
+ cselib_val *canon;
+
+ if (!val->locs || val->locs->next
+ || !val->locs->loc || GET_CODE (val->locs->loc) != VALUE
+ || val->uid < CSELIB_VAL_PTR (val->locs->loc)->uid)
+ return val;
+
+ canon = CSELIB_VAL_PTR (val->locs->loc);
+ gcc_checking_assert (canonical_cselib_val (canon) == canon);
+ return canon;
+}