diff options
author | Serguei Katkov <serguei.i.katkov@intel.com> | 2014-07-05 00:55:46 +0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-07-11 15:55:07 -0700 |
commit | 59a42afc2b23d2e241a7e301e2cd68a94fba51e5 (patch) | |
tree | 6f59a144ea0e3b0081205a999f5d0ac2d5846fad /compiler/dex/quick/ralloc_util.cc | |
parent | 946a55fa7aec5058d357b601ac3554e242cd1afa (diff) | |
download | android_art-59a42afc2b23d2e241a7e301e2cd68a94fba51e5.tar.gz android_art-59a42afc2b23d2e241a7e301e2cd68a94fba51e5.tar.bz2 android_art-59a42afc2b23d2e241a7e301e2cd68a94fba51e5.zip |
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 <serguei.i.katkov@intel.com>
Diffstat (limited to 'compiler/dex/quick/ralloc_util.cc')
-rw-r--r-- | compiler/dex/quick/ralloc_util.cc | 17 |
1 files changed, 10 insertions, 7 deletions
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; } } } |