summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/ralloc_util.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2013-02-07 15:22:39 -0800
committer buzbee <buzbee@google.com> 2013-02-08 21:49:55 -0800
commitc7d1f91e024c5c560810376340aecb39d4e47fdc (patch)
tree28e4f239a65cce19423e53a3d0a2162906df956d /src/compiler/codegen/ralloc_util.cc
parent987db603952c9b2a2c3f7cf28bd76638ea6ae2b0 (diff)
Codegen tweaks
Minor codegen cleanup. Most significant part of change is fixing dalvik register use counting to correctly record cost of high word of register pair. Significant boost to Reversi benchmark; modest gain for Caffeinemark. Change-Id: I41819e6d7be93e62d259240269339a94a934f312
Diffstat (limited to 'src/compiler/codegen/ralloc_util.cc')
-rw-r--r--src/compiler/codegen/ralloc_util.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/compiler/codegen/ralloc_util.cc b/src/compiler/codegen/ralloc_util.cc
index 1d5f3aca86..3a3aeba332 100644
--- a/src/compiler/codegen/ralloc_util.cc
+++ b/src/compiler/codegen/ralloc_util.cc
@@ -1082,27 +1082,22 @@ RegLocation GetSrcWide(CompilationUnit* cu, MIR* mir,
static void CountRefs(CompilationUnit *cu, BasicBlock* bb, RefCounts* core_counts,
RefCounts* fp_counts)
{
+ // TUNING: this routine could use some tweaking.
if ((cu->disable_opt & (1 << kPromoteRegs)) ||
!((bb->block_type == kEntryBlock) || (bb->block_type == kExitBlock) ||
(bb->block_type == kDalvikByteCode))) {
return;
}
- for (int i = 0; i < cu->num_ssa_regs;) {
+ for (int i = 0; i < cu->num_ssa_regs; i++) {
RegLocation loc = cu->reg_location[i];
RefCounts* counts = loc.fp ? fp_counts : core_counts;
int p_map_idx = SRegToPMap(cu, loc.s_reg_low);
//Don't count easily regenerated immediates
- if (loc.fp || loc.wide || !IsInexpensiveConstant(cu, loc)) {
- counts[p_map_idx].count += cu->use_counts.elem_list[i];
+ if (loc.fp || !IsInexpensiveConstant(cu, loc)) {
+ counts[p_map_idx].count += cu->raw_use_counts.elem_list[i];
}
- if (loc.wide) {
- if (loc.fp) {
- counts[p_map_idx].double_start = true;
- counts[p_map_idx+1].count += cu->use_counts.elem_list[i+1];
- }
- i += 2;
- } else {
- i++;
+ if (loc.wide && loc.fp && !loc.high_word) {
+ counts[p_map_idx].double_start = true;
}
}
}