From 4220fca9bcb7ba0d4c680f8fd03d498a39daf663 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 3 Sep 2009 16:51:37 +0000 Subject: [PATCH] tweak optimistic split heuristic to take execfreq of the potential copy into account [r26483] --- ir/be/benewalloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ir/be/benewalloc.c b/ir/be/benewalloc.c index 906ee3407..db4161706 100644 --- a/ir/be/benewalloc.c +++ b/ir/be/benewalloc.c @@ -570,6 +570,7 @@ static bool try_optimistic_split(ir_node *to_split, ir_node *before, allocation_info_t *info = get_allocation_info(to_split); reg_pref_t *prefs; float delta; + float split_threshold; (void) pref; @@ -596,15 +597,16 @@ static bool try_optimistic_split(ir_node *to_split, ir_node *before, return false; } /* TODO: use execfreq somehow... */ + block = get_nodes_block(before); delta = pref_delta + prefs[i].pref; - if (delta < SPLIT_DELTA) { + split_threshold = get_block_execfreq(execfreqs, block) * SPLIT_DELTA; + if (delta < split_threshold) { DB((dbg, LEVEL_3, "Not doing optimistical split, win %f too low\n", delta)); return false; } reg = arch_register_for_index(cls, r); - block = get_nodes_block(before); copy = be_new_Copy(cls, block, to_split); mark_as_copy_of(copy, to_split); free_reg_of_value(to_split); -- 2.20.1