Skip to content

Commit a99f6bb

Browse files
committed
[IRA]: Fixing conflict calculation from region landing pads.
The following patch fixes conflict calculation from exception landing pads. The previous patch processed only one newly created landing pad. Besides it was wrong, it also resulted in large memory consumption by IRA. gcc/ChangeLog: PR rtl-optimization/110215 * ira-lives.cc: (add_conflict_from_region_landing_pads): New function. (process_bb_node_lives): Use it.
1 parent c4cf9aa commit a99f6bb

File tree

1 file changed

+28
-16
lines changed

1 file changed

+28
-16
lines changed

gcc/ira-lives.cc

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,32 @@ process_out_of_region_eh_regs (basic_block bb)
12141214

12151215
#endif
12161216

1217+
/* Add conflicts for object OBJ from REGION landing pads using CALLEE_ABI. */
1218+
static void
1219+
add_conflict_from_region_landing_pads (eh_region region, ira_object_t obj,
1220+
function_abi callee_abi)
1221+
{
1222+
ira_allocno_t a = OBJECT_ALLOCNO (obj);
1223+
rtx_code_label *landing_label;
1224+
basic_block landing_bb;
1225+
1226+
for (eh_landing_pad lp = region->landing_pads; lp ; lp = lp->next_lp)
1227+
{
1228+
if ((landing_label = lp->landing_pad) != NULL
1229+
&& (landing_bb = BLOCK_FOR_INSN (landing_label)) != NULL
1230+
&& (region->type != ERT_CLEANUP
1231+
|| bitmap_bit_p (df_get_live_in (landing_bb),
1232+
ALLOCNO_REGNO (a))))
1233+
{
1234+
HARD_REG_SET new_conflict_regs
1235+
= callee_abi.mode_clobbers (ALLOCNO_MODE (a));
1236+
OBJECT_CONFLICT_HARD_REGS (obj) |= new_conflict_regs;
1237+
OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) |= new_conflict_regs;
1238+
return;
1239+
}
1240+
}
1241+
}
1242+
12171243
/* Process insns of the basic block given by its LOOP_TREE_NODE to
12181244
update allocno live ranges, allocno hard register conflicts,
12191245
intersected calls, and register pressure info for allocnos for the
@@ -1385,23 +1411,9 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node)
13851411
SET_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj));
13861412
}
13871413
eh_region r;
1388-
eh_landing_pad lp;
1389-
rtx_code_label *landing_label;
1390-
basic_block landing_bb;
13911414
if (can_throw_internal (insn)
1392-
&& (r = get_eh_region_from_rtx (insn)) != NULL
1393-
&& (lp = gen_eh_landing_pad (r)) != NULL
1394-
&& (landing_label = lp->landing_pad) != NULL
1395-
&& (landing_bb = BLOCK_FOR_INSN (landing_label)) != NULL
1396-
&& (r->type != ERT_CLEANUP
1397-
|| bitmap_bit_p (df_get_live_in (landing_bb),
1398-
ALLOCNO_REGNO (a))))
1399-
{
1400-
HARD_REG_SET new_conflict_regs
1401-
= callee_abi.mode_clobbers (ALLOCNO_MODE (a));
1402-
OBJECT_CONFLICT_HARD_REGS (obj) |= new_conflict_regs;
1403-
OBJECT_TOTAL_CONFLICT_HARD_REGS (obj) |= new_conflict_regs;
1404-
}
1415+
&& (r = get_eh_region_from_rtx (insn)) != NULL)
1416+
add_conflict_from_region_landing_pads (r, obj, callee_abi);
14051417
if (sparseset_bit_p (allocnos_processed, num))
14061418
continue;
14071419
sparseset_set_bit (allocnos_processed, num);

0 commit comments

Comments
 (0)