diff options
author | Peter Bergner <bergner@linux.ibm.com> | 2018-09-30 20:03:14 +0000 |
---|---|---|
committer | Peter Bergner <bergner@gcc.gnu.org> | 2018-09-30 15:03:14 -0500 |
commit | 0df92803a9f297fd8af6f23b224f15e1cf12f12a (patch) | |
tree | b6dae223a430f5e7fecd8cf91c5602da541d0401 /gcc/ira-lives.c | |
parent | a086078b8f7ee2580e55afc03026acf63bfb9605 (diff) | |
download | gcc-0df92803a9f297fd8af6f23b224f15e1cf12f12a.zip gcc-0df92803a9f297fd8af6f23b224f15e1cf12f12a.tar.gz gcc-0df92803a9f297fd8af6f23b224f15e1cf12f12a.tar.bz2 |
re PR rtl-optimization/86939 (IRA incorrectly creates an interference between a pseudo register and a hard register)
gcc/
PR rtl-optimization/86939
* ira-lives.c (make_hard_regno_born): Rename from this...
(make_hard_regno_live): ... to this. Remove update to conflict
information. Update function comment.
(make_hard_regno_dead): Add conflict information update. Update
function comment.
(make_object_born): Rename from this...
(make_object_live): ... to this. Remove update to conflict information.
Update function comment.
(make_object_dead): Add conflict information update. Update function
comment.
(mark_pseudo_regno_live): Call make_object_live.
(mark_pseudo_regno_subword_live): Likewise.
(mark_hard_reg_dead): Update function comment.
(mark_hard_reg_live): Call make_hard_regno_live.
(process_bb_node_lives): Likewise.
* lra-lives.c (make_hard_regno_born): Rename from this...
(make_hard_regno_live): ... to this. Remove update to conflict
information. Remove now uneeded check_pic_pseudo_p argument.
Update function comment.
(make_hard_regno_dead): Add check_pic_pseudo_p argument and add update
to conflict information. Update function comment.
(mark_pseudo_live): Remove update to conflict information. Update
function comment.
(mark_pseudo_dead): Add conflict information update.
(mark_regno_live): Call make_hard_regno_live.
(mark_regno_dead): Call make_hard_regno_dead with new arguement.
(process_bb_lives): Call make_hard_regno_live and make_hard_regno_dead.
From-SVN: r264726
Diffstat (limited to 'gcc/ira-lives.c')
-rw-r--r-- | gcc/ira-lives.c | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c index b38d4a5..ab8ad4a 100644 --- a/gcc/ira-lives.c +++ b/gcc/ira-lives.c @@ -84,14 +84,19 @@ static int *allocno_saved_at_call; supplemental to recog_data. */ static alternative_mask preferred_alternatives; -/* Record the birth of hard register REGNO, updating hard_regs_live and - hard reg conflict information for living allocnos. */ +/* Record hard register REGNO as now being live. */ static void -make_hard_regno_born (int regno) +make_hard_regno_live (int regno) { - unsigned int i; - SET_HARD_REG_BIT (hard_regs_live, regno); +} + +/* Process the definition of hard register REGNO. This updates + hard_regs_live and hard reg conflict information for living allocnos. */ +static void +make_hard_regno_dead (int regno) +{ + unsigned int i; EXECUTE_IF_SET_IN_SPARSESET (objects_live, i) { ira_object_t obj = ira_object_id_map[i]; @@ -99,28 +104,17 @@ make_hard_regno_born (int regno) SET_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj), regno); SET_HARD_REG_BIT (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), regno); } -} - -/* Process the death of hard register REGNO. This updates - hard_regs_live. */ -static void -make_hard_regno_dead (int regno) -{ CLEAR_HARD_REG_BIT (hard_regs_live, regno); } -/* Record the birth of object OBJ. Set a bit for it in objects_live, - start a new live range for it if necessary and update hard register - conflicts. */ +/* Record object OBJ as now being live. Set a bit for it in objects_live, + and start a new live range for it if necessary. */ static void -make_object_born (ira_object_t obj) +make_object_live (ira_object_t obj) { - live_range_t lr = OBJECT_LIVE_RANGES (obj); - sparseset_set_bit (objects_live, OBJECT_CONFLICT_ID (obj)); - IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj), hard_regs_live); - IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), hard_regs_live); + live_range_t lr = OBJECT_LIVE_RANGES (obj); if (lr == NULL || (lr->finish != curr_point && lr->finish + 1 != curr_point)) ira_add_live_range_to_object (obj, curr_point, -1); @@ -154,14 +148,18 @@ update_allocno_pressure_excess_length (ira_object_t obj) } } -/* Process the death of object OBJ, which is associated with allocno - A. This finishes the current live range for it. */ +/* Process the definition of object OBJ, which is associated with allocno A. + This finishes the current live range for it. */ static void make_object_dead (ira_object_t obj) { live_range_t lr; sparseset_clear_bit (objects_live, OBJECT_CONFLICT_ID (obj)); + + IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj), hard_regs_live); + IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), hard_regs_live); + lr = OBJECT_LIVE_RANGES (obj); ira_assert (lr != NULL); lr->finish = curr_point; @@ -290,7 +288,7 @@ mark_pseudo_regno_live (int regno) continue; inc_register_pressure (pclass, nregs); - make_object_born (obj); + make_object_live (obj); } } @@ -327,7 +325,7 @@ mark_pseudo_regno_subword_live (int regno, int subword) return; inc_register_pressure (pclass, 1); - make_object_born (obj); + make_object_live (obj); } /* Mark the register REG as live. Store a 1 in hard_regs_live for @@ -351,7 +349,7 @@ mark_hard_reg_live (rtx reg) aclass = ira_hard_regno_allocno_class[regno]; pclass = ira_pressure_class_translate[aclass]; inc_register_pressure (pclass, 1); - make_hard_regno_born (regno); + make_hard_regno_live (regno); } regno++; } @@ -457,8 +455,8 @@ mark_pseudo_regno_subword_dead (int regno, int subword) make_object_dead (obj); } -/* Mark the hard register REG as dead. Store a 0 in hard_regs_live for the - register. */ +/* Process the definition of hard register REG. This updates hard_regs_live + and hard reg conflict information for living allocnos. */ static void mark_hard_reg_dead (rtx reg) { @@ -1298,7 +1296,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) unsigned int regno = EH_RETURN_DATA_REGNO (j); if (regno == INVALID_REGNUM) break; - make_hard_regno_born (regno); + make_hard_regno_live (regno); } /* Allocnos can't go in stack regs at the start of a basic block @@ -1317,7 +1315,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) ALLOCNO_TOTAL_NO_STACK_REG_P (a) = true; } for (px = FIRST_STACK_REG; px <= LAST_STACK_REG; px++) - make_hard_regno_born (px); + make_hard_regno_live (px); #endif /* No need to record conflicts for call clobbered regs if we have nonlocal labels around, as we don't ever try to @@ -1340,7 +1338,7 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) && REGNO (pic_offset_table_rtx) >= FIRST_PSEUDO_REGISTER) #endif ) - make_hard_regno_born (px); + make_hard_regno_live (px); } EXECUTE_IF_SET_IN_SPARSESET (objects_live, i) |