From 59a42afc2b23d2e241a7e301e2cd68a94fba51e5 Mon Sep 17 00:00:00 2001 From: Serguei Katkov Date: Sat, 5 Jul 2014 00:55:46 +0700 Subject: Update counting VR for promotion For 64-bit it makes sense to compute VR uses together for int and long because core reg is shared. Change-Id: Ie8676ece12c928d090da2465dfb4de4e91411920 Signed-off-by: Serguei Katkov --- compiler/dex/quick/ralloc_util.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'compiler/dex/quick/ralloc_util.cc') diff --git a/compiler/dex/quick/ralloc_util.cc b/compiler/dex/quick/ralloc_util.cc index e8fc919d5f..fa1c36eaa6 100644 --- a/compiler/dex/quick/ralloc_util.cc +++ b/compiler/dex/quick/ralloc_util.cc @@ -1157,20 +1157,23 @@ void Mir2Lir::CountRefs(RefCounts* core_counts, RefCounts* fp_counts, size_t num int use_count = mir_graph_->GetUseCount(i); if (loc.fp) { if (loc.wide) { - // Treat doubles as a unit, using upper half of fp_counts array. - counts[p_map_idx + num_regs].count += use_count; + if (WideFPRsAreAliases()) { + // Floats and doubles can be counted together. + counts[p_map_idx].count += use_count; + } else { + // Treat doubles as a unit, using upper half of fp_counts array. + counts[p_map_idx + num_regs].count += use_count; + } i++; } else { counts[p_map_idx].count += use_count; } } else if (!IsInexpensiveConstant(loc)) { - if (loc.wide && cu_->target64) { - // Treat long as a unit, using upper half of core_counts array. - counts[p_map_idx + num_regs].count += use_count; + if (loc.wide && WideGPRsAreAliases()) { + // Longs and doubles can be counted together. i++; - } else { - counts[p_map_idx].count += use_count; } + counts[p_map_idx].count += use_count; } } } -- cgit v1.2.3-59-g8ed1b