diff options
author | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-23 17:38:59 +0000 |
---|---|---|
committer | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-23 17:38:59 +0000 |
commit | a10644908ca71b6974af31acb8fa88a512d854c4 (patch) | |
tree | 17afa8226cdc7da00b678c19aa87047ca1ddfd18 /gcc/lra-int.h | |
parent | 5e1781b68cf0eb85143c9d56d39c32d53ef83c5b (diff) | |
download | gcc-a10644908ca71b6974af31acb8fa88a512d854c4.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198204 138bc75d-0d04-0410-961f-82ee72b054a4
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 5ec7fa12502..3d7ecb35e09 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 |