diff options
author | Shiva Chen <shiva0217@gmail.com> | 2013-04-23 17:38:59 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2013-04-23 17:38:59 +0000 |
commit | d70a81dddc916c55892c5b73bed2138b71bd5945 (patch) | |
tree | 17afa8226cdc7da00b678c19aa87047ca1ddfd18 /gcc/lra-int.h | |
parent | b894a1f3464f4f56ce2318c019ec3855794f7118 (diff) | |
download | gcc-d70a81dddc916c55892c5b73bed2138b71bd5945.zip gcc-d70a81dddc916c55892c5b73bed2138b71bd5945.tar.gz gcc-d70a81dddc916c55892c5b73bed2138b71bd5945.tar.bz2 |
lra-assigns.c (find_hard_regno_for): Use lra_reg_val_equal_p to check the register content is equal or not.
2013-04-23 Shiva Chen <shiva0217@gmail.com>
* lra-assigns.c (find_hard_regno_for): Use lra_reg_val_equal_p
to check the register content is equal or not.
* lra-constraints.c (match_reload): Use lra_assign_reg_val
to assign register content record.
* lra-eliminations.c (update_reg_eliminate): Use
lra_update_reg_val_offset to update register content offset.
* lra-int.h (struct lra_reg): Add offset member.
(lra_reg_val_equal_p): New static inline function.
(lra_update_reg_val_offset): New static inline function.
(lra_assign_reg_val): New static inline function.
* lra.c (lra_create_new_reg): Use lra_assign_reg_val
to assign register content record.
(initialize_lra_reg_info_element): Initial offset to zero.
From-SVN: r198204
Diffstat (limited to 'gcc/lra-int.h')
-rw-r--r-- | gcc/lra-int.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/lra-int.h b/gcc/lra-int.h index 5ec7fa1..3d7ecb3 100644 --- a/gcc/lra-int.h +++ b/gcc/lra-int.h @@ -118,6 +118,8 @@ struct lra_reg /* Value holding by register. If the pseudos have the same value they do not conflict. */ int val; + /* Offset from relative eliminate register to pesudo reg. */ + int offset; /* These members are set up in lra-lives.c and updated in lra-coalesce.c. */ /* The biggest size mode in which each pseudo reg is referred in @@ -443,6 +445,37 @@ lra_get_insn_recog_data (rtx insn) return lra_set_insn_recog_data (insn); } +/* Update offset from pseudos with VAL by INCR. */ +static inline void +lra_update_reg_val_offset (int val, int incr) +{ + int i; + + for (i = FIRST_PSEUDO_REGISTER; i < max_reg_num (); i++) + { + if (lra_reg_info[i].val == val) + lra_reg_info[i].offset += incr; + } +} + +/* Return true if register content is equal to VAL with OFFSET. */ +static inline bool +lra_reg_val_equal_p (int regno, int val, int offset) +{ + if (lra_reg_info[regno].val == val + && lra_reg_info[regno].offset == offset) + return true; + + return false; +} + +/* Assign value of register FROM to TO. */ +static inline void +lra_assign_reg_val (int from, int to) +{ + lra_reg_info[to].val = lra_reg_info[from].val; + lra_reg_info[to].offset = lra_reg_info[from].offset; +} struct target_lra_int |