buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 17 | #include "compiler_internals.h" |
| 18 | #include "dataflow.h" |
buzbee | eaf09bc | 2012-11-15 14:51:41 -0800 | [diff] [blame] | 19 | #include "codegen/ralloc_util.h" |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 20 | |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 21 | namespace art { |
| 22 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 23 | static bool SetFp(CompilationUnit* cu, int index, bool is_fp) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 24 | bool change = false; |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 25 | if (is_fp && !cu->reg_location[index].fp) { |
| 26 | cu->reg_location[index].fp = true; |
| 27 | cu->reg_location[index].defined = true; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 28 | change = true; |
| 29 | } |
| 30 | return change; |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 31 | } |
| 32 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 33 | static bool SetCore(CompilationUnit* cu, int index, bool is_core) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 34 | bool change = false; |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 35 | if (is_core && !cu->reg_location[index].defined) { |
| 36 | cu->reg_location[index].core = true; |
| 37 | cu->reg_location[index].defined = true; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 38 | change = true; |
| 39 | } |
| 40 | return change; |
buzbee | 03fa263 | 2011-09-20 17:10:57 -0700 | [diff] [blame] | 41 | } |
| 42 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 43 | static bool SetRef(CompilationUnit* cu, int index, bool is_ref) { |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 44 | bool change = false; |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 45 | if (is_ref && !cu->reg_location[index].defined) { |
| 46 | cu->reg_location[index].ref = true; |
| 47 | cu->reg_location[index].defined = true; |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 48 | change = true; |
| 49 | } |
| 50 | return change; |
| 51 | } |
| 52 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 53 | static bool SetWide(CompilationUnit* cu, int index, bool is_wide) { |
buzbee | 2a83e8f | 2012-07-13 16:42:30 -0700 | [diff] [blame] | 54 | bool change = false; |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 55 | if (is_wide && !cu->reg_location[index].wide) { |
| 56 | cu->reg_location[index].wide = true; |
buzbee | 2a83e8f | 2012-07-13 16:42:30 -0700 | [diff] [blame] | 57 | change = true; |
| 58 | } |
| 59 | return change; |
| 60 | } |
| 61 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 62 | static bool SetHigh(CompilationUnit* cu, int index, bool is_high) { |
buzbee | 2a83e8f | 2012-07-13 16:42:30 -0700 | [diff] [blame] | 63 | bool change = false; |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 64 | if (is_high && !cu->reg_location[index].high_word) { |
| 65 | cu->reg_location[index].high_word = true; |
buzbee | 2a83e8f | 2012-07-13 16:42:30 -0700 | [diff] [blame] | 66 | change = true; |
| 67 | } |
| 68 | return change; |
| 69 | } |
| 70 | |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 71 | /* |
buzbee | 03fa263 | 2011-09-20 17:10:57 -0700 | [diff] [blame] | 72 | * Infer types and sizes. We don't need to track change on sizes, |
| 73 | * as it doesn't propagate. We're guaranteed at least one pass through |
| 74 | * the cfg. |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 75 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 76 | static bool InferTypeAndSize(CompilationUnit* cu, BasicBlock* bb) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 77 | { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 78 | MIR *mir; |
| 79 | bool changed = false; // Did anything change? |
buzbee | 03fa263 | 2011-09-20 17:10:57 -0700 | [diff] [blame] | 80 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 81 | if (bb->data_flow_info == NULL) return false; |
| 82 | if (bb->block_type != kDalvikByteCode && bb->block_type != kEntryBlock) |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 83 | return false; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 84 | |
buzbee | 28c9a83 | 2012-11-21 15:39:13 -0800 | [diff] [blame] | 85 | for (mir = bb->first_mir_insn; mir != NULL; mir = mir->next) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 86 | SSARepresentation *ssa_rep = mir->ssa_rep; |
| 87 | if (ssa_rep) { |
| 88 | int attrs = oat_data_flow_attributes[mir->dalvikInsn.opcode]; |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 89 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 90 | // Handle defs |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 91 | if (attrs & DF_DA) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 92 | if (attrs & DF_CORE_A) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 93 | changed |= SetCore(cu, ssa_rep->defs[0], true); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 94 | } |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 95 | if (attrs & DF_REF_A) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 96 | changed |= SetRef(cu, ssa_rep->defs[0], true); |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 97 | } |
| 98 | if (attrs & DF_A_WIDE) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 99 | cu->reg_location[ssa_rep->defs[0]].wide = true; |
| 100 | cu->reg_location[ssa_rep->defs[1]].wide = true; |
| 101 | cu->reg_location[ssa_rep->defs[1]].high_word = true; |
| 102 | DCHECK_EQ(SRegToVReg(cu, ssa_rep->defs[0])+1, |
| 103 | SRegToVReg(cu, ssa_rep->defs[1])); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 104 | } |
| 105 | } |
| 106 | |
| 107 | // Handles uses |
| 108 | int next = 0; |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 109 | if (attrs & DF_UA) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 110 | if (attrs & DF_CORE_A) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 111 | changed |= SetCore(cu, ssa_rep->uses[next], true); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 112 | } |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 113 | if (attrs & DF_REF_A) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 114 | changed |= SetRef(cu, ssa_rep->uses[next], true); |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 115 | } |
| 116 | if (attrs & DF_A_WIDE) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 117 | cu->reg_location[ssa_rep->uses[next]].wide = true; |
| 118 | cu->reg_location[ssa_rep->uses[next + 1]].wide = true; |
| 119 | cu->reg_location[ssa_rep->uses[next + 1]].high_word = true; |
| 120 | DCHECK_EQ(SRegToVReg(cu, ssa_rep->uses[next])+1, |
| 121 | SRegToVReg(cu, ssa_rep->uses[next + 1])); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 122 | next += 2; |
| 123 | } else { |
| 124 | next++; |
| 125 | } |
| 126 | } |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 127 | if (attrs & DF_UB) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 128 | if (attrs & DF_CORE_B) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 129 | changed |= SetCore(cu, ssa_rep->uses[next], true); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 130 | } |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 131 | if (attrs & DF_REF_B) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 132 | changed |= SetRef(cu, ssa_rep->uses[next], true); |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 133 | } |
| 134 | if (attrs & DF_B_WIDE) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 135 | cu->reg_location[ssa_rep->uses[next]].wide = true; |
| 136 | cu->reg_location[ssa_rep->uses[next + 1]].wide = true; |
| 137 | cu->reg_location[ssa_rep->uses[next + 1]].high_word = true; |
| 138 | DCHECK_EQ(SRegToVReg(cu, ssa_rep->uses[next])+1, |
| 139 | SRegToVReg(cu, ssa_rep->uses[next + 1])); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 140 | next += 2; |
| 141 | } else { |
| 142 | next++; |
| 143 | } |
| 144 | } |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 145 | if (attrs & DF_UC) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 146 | if (attrs & DF_CORE_C) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 147 | changed |= SetCore(cu, ssa_rep->uses[next], true); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 148 | } |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 149 | if (attrs & DF_REF_C) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 150 | changed |= SetRef(cu, ssa_rep->uses[next], true); |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 151 | } |
| 152 | if (attrs & DF_C_WIDE) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 153 | cu->reg_location[ssa_rep->uses[next]].wide = true; |
| 154 | cu->reg_location[ssa_rep->uses[next + 1]].wide = true; |
| 155 | cu->reg_location[ssa_rep->uses[next + 1]].high_word = true; |
| 156 | DCHECK_EQ(SRegToVReg(cu, ssa_rep->uses[next])+1, |
| 157 | SRegToVReg(cu, ssa_rep->uses[next + 1])); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 158 | } |
| 159 | } |
| 160 | |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 161 | // Special-case return handling |
| 162 | if ((mir->dalvikInsn.opcode == Instruction::RETURN) || |
| 163 | (mir->dalvikInsn.opcode == Instruction::RETURN_WIDE) || |
| 164 | (mir->dalvikInsn.opcode == Instruction::RETURN_OBJECT)) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 165 | switch(cu->shorty[0]) { |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 166 | case 'I': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 167 | changed |= SetCore(cu, ssa_rep->uses[0], true); |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 168 | break; |
| 169 | case 'J': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 170 | changed |= SetCore(cu, ssa_rep->uses[0], true); |
| 171 | changed |= SetCore(cu, ssa_rep->uses[1], true); |
| 172 | cu->reg_location[ssa_rep->uses[0]].wide = true; |
| 173 | cu->reg_location[ssa_rep->uses[1]].wide = true; |
| 174 | cu->reg_location[ssa_rep->uses[1]].high_word = true; |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 175 | break; |
| 176 | case 'F': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 177 | changed |= SetFp(cu, ssa_rep->uses[0], true); |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 178 | break; |
| 179 | case 'D': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 180 | changed |= SetFp(cu, ssa_rep->uses[0], true); |
| 181 | changed |= SetFp(cu, ssa_rep->uses[1], true); |
| 182 | cu->reg_location[ssa_rep->uses[0]].wide = true; |
| 183 | cu->reg_location[ssa_rep->uses[1]].wide = true; |
| 184 | cu->reg_location[ssa_rep->uses[1]].high_word = true; |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 185 | break; |
| 186 | case 'L': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 187 | changed |= SetRef(cu, ssa_rep->uses[0], true); |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 188 | break; |
| 189 | default: break; |
| 190 | } |
| 191 | } |
| 192 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 193 | // Special-case handling for format 35c/3rc invokes |
| 194 | Instruction::Code opcode = mir->dalvikInsn.opcode; |
| 195 | int flags = (static_cast<int>(opcode) >= kNumPackedOpcodes) |
Ian Rogers | a75a013 | 2012-09-28 11:41:42 -0700 | [diff] [blame] | 196 | ? 0 : Instruction::FlagsOf(mir->dalvikInsn.opcode); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 197 | if ((flags & Instruction::kInvoke) && |
| 198 | (attrs & (DF_FORMAT_35C | DF_FORMAT_3RC))) { |
| 199 | DCHECK_EQ(next, 0); |
| 200 | int target_idx = mir->dalvikInsn.vB; |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 201 | const char* shorty = GetShortyFromTargetIdx(cu, target_idx); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 202 | // Handle result type if floating point |
| 203 | if ((shorty[0] == 'F') || (shorty[0] == 'D')) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 204 | MIR* move_result_mir = FindMoveResult(cu, bb, mir); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 205 | // Result might not be used at all, so no move-result |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 206 | if (move_result_mir && (move_result_mir->dalvikInsn.opcode != |
Bill Buzbee | c9f40dd | 2012-08-15 11:35:25 -0700 | [diff] [blame] | 207 | Instruction::MOVE_RESULT_OBJECT)) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 208 | SSARepresentation* tgt_rep = move_result_mir->ssa_rep; |
| 209 | DCHECK(tgt_rep != NULL); |
| 210 | tgt_rep->fp_def[0] = true; |
| 211 | changed |= SetFp(cu, tgt_rep->defs[0], true); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 212 | if (shorty[0] == 'D') { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 213 | tgt_rep->fp_def[1] = true; |
| 214 | changed |= SetFp(cu, tgt_rep->defs[1], true); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 215 | } |
| 216 | } |
| 217 | } |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 218 | int num_uses = mir->dalvikInsn.vA; |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 219 | // If this is a non-static invoke, mark implicit "this" |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 220 | if (((mir->dalvikInsn.opcode != Instruction::INVOKE_STATIC) && |
| 221 | (mir->dalvikInsn.opcode != Instruction::INVOKE_STATIC_RANGE))) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 222 | cu->reg_location[ssa_rep->uses[next]].defined = true; |
| 223 | cu->reg_location[ssa_rep->uses[next]].ref = true; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 224 | next++; |
| 225 | } |
| 226 | uint32_t cpos = 1; |
| 227 | if (strlen(shorty) > 1) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 228 | for (int i = next; i < num_uses;) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 229 | DCHECK_LT(cpos, strlen(shorty)); |
| 230 | switch (shorty[cpos++]) { |
| 231 | case 'D': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 232 | ssa_rep->fp_use[i] = true; |
| 233 | ssa_rep->fp_use[i+1] = true; |
| 234 | cu->reg_location[ssa_rep->uses[i]].wide = true; |
| 235 | cu->reg_location[ssa_rep->uses[i+1]].wide = true; |
| 236 | cu->reg_location[ssa_rep->uses[i+1]].high_word = true; |
| 237 | DCHECK_EQ(SRegToVReg(cu, ssa_rep->uses[i])+1, |
| 238 | SRegToVReg(cu, ssa_rep->uses[i+1])); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 239 | i++; |
| 240 | break; |
| 241 | case 'J': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 242 | cu->reg_location[ssa_rep->uses[i]].wide = true; |
| 243 | cu->reg_location[ssa_rep->uses[i+1]].wide = true; |
| 244 | cu->reg_location[ssa_rep->uses[i+1]].high_word = true; |
| 245 | DCHECK_EQ(SRegToVReg(cu, ssa_rep->uses[i])+1, |
| 246 | SRegToVReg(cu, ssa_rep->uses[i+1])); |
| 247 | changed |= SetCore(cu, ssa_rep->uses[i],true); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 248 | i++; |
| 249 | break; |
| 250 | case 'F': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 251 | ssa_rep->fp_use[i] = true; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 252 | break; |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 253 | case 'L': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 254 | changed |= SetRef(cu,ssa_rep->uses[i], true); |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 255 | break; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 256 | default: |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 257 | changed |= SetCore(cu,ssa_rep->uses[i], true); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 258 | break; |
| 259 | } |
| 260 | i++; |
| 261 | } |
| 262 | } |
| 263 | } |
| 264 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 265 | for (int i=0; ssa_rep->fp_use && i< ssa_rep->num_uses; i++) { |
| 266 | if (ssa_rep->fp_use[i]) |
| 267 | changed |= SetFp(cu, ssa_rep->uses[i], true); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 268 | } |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 269 | for (int i=0; ssa_rep->fp_def && i< ssa_rep->num_defs; i++) { |
| 270 | if (ssa_rep->fp_def[i]) |
| 271 | changed |= SetFp(cu, ssa_rep->defs[i], true); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 272 | } |
| 273 | // Special-case handling for moves & Phi |
| 274 | if (attrs & (DF_IS_MOVE | DF_NULL_TRANSFER_N)) { |
buzbee | 2a83e8f | 2012-07-13 16:42:30 -0700 | [diff] [blame] | 275 | /* |
| 276 | * If any of our inputs or outputs is defined, set all. |
| 277 | * Some ugliness related to Phi nodes and wide values. |
| 278 | * The Phi set will include all low words or all high |
| 279 | * words, so we have to treat them specially. |
| 280 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 281 | bool is_phi = (static_cast<int>(mir->dalvikInsn.opcode) == |
buzbee | 2a83e8f | 2012-07-13 16:42:30 -0700 | [diff] [blame] | 282 | kMirOpPhi); |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 283 | RegLocation rl_temp = cu->reg_location[ssa_rep->defs[0]]; |
| 284 | bool defined_fp = rl_temp.defined && rl_temp.fp; |
| 285 | bool defined_core = rl_temp.defined && rl_temp.core; |
| 286 | bool defined_ref = rl_temp.defined && rl_temp.ref; |
| 287 | bool is_wide = rl_temp.wide || ((attrs & DF_A_WIDE) != 0); |
| 288 | bool is_high = is_phi && rl_temp.wide && rl_temp.high_word; |
| 289 | for (int i = 0; i < ssa_rep->num_uses;i++) { |
| 290 | rl_temp = cu->reg_location[ssa_rep->uses[i]]; |
| 291 | defined_fp |= rl_temp.defined && rl_temp.fp; |
| 292 | defined_core |= rl_temp.defined && rl_temp.core; |
| 293 | defined_ref |= rl_temp.defined && rl_temp.ref; |
| 294 | is_wide |= rl_temp.wide; |
| 295 | is_high |= is_phi && rl_temp.wide && rl_temp.high_word; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 296 | } |
| 297 | /* |
| 298 | * TODO: cleaner fix |
| 299 | * We don't normally expect to see a Dalvik register |
| 300 | * definition used both as a floating point and core |
| 301 | * value. However, the instruction rewriting that occurs |
| 302 | * during verification can eliminate some type information, |
| 303 | * leaving us confused. The real fix here is either to |
| 304 | * add explicit type information to Dalvik byte codes, |
| 305 | * or to recognize THROW_VERIFICATION_ERROR as |
| 306 | * an unconditional branch and support dead code elimination. |
| 307 | * As a workaround we can detect this situation and |
| 308 | * disable register promotion (which is the only thing that |
| 309 | * relies on distinctions between core and fp usages. |
| 310 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 311 | if ((defined_fp && (defined_core | defined_ref)) && |
| 312 | ((cu->disable_opt & (1 << kPromoteRegs)) == 0)) { |
| 313 | LOG(WARNING) << PrettyMethod(cu->method_idx, *cu->dex_file) |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 314 | << " op at block " << bb->id |
buzbee | bff2465 | 2012-05-06 16:22:05 -0700 | [diff] [blame] | 315 | << " has both fp and core/ref uses for same def."; |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 316 | cu->disable_opt |= (1 << kPromoteRegs); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 317 | } |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 318 | changed |= SetFp(cu, ssa_rep->defs[0], defined_fp); |
| 319 | changed |= SetCore(cu, ssa_rep->defs[0], defined_core); |
| 320 | changed |= SetRef(cu, ssa_rep->defs[0], defined_ref); |
| 321 | changed |= SetWide(cu, ssa_rep->defs[0], is_wide); |
| 322 | changed |= SetHigh(cu, ssa_rep->defs[0], is_high); |
buzbee | 2a83e8f | 2012-07-13 16:42:30 -0700 | [diff] [blame] | 323 | if (attrs & DF_A_WIDE) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 324 | changed |= SetWide(cu, ssa_rep->defs[1], true); |
| 325 | changed |= SetHigh(cu, ssa_rep->defs[1], true); |
buzbee | 2a83e8f | 2012-07-13 16:42:30 -0700 | [diff] [blame] | 326 | } |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 327 | for (int i = 0; i < ssa_rep->num_uses; i++) { |
| 328 | changed |= SetFp(cu, ssa_rep->uses[i], defined_fp); |
| 329 | changed |= SetCore(cu, ssa_rep->uses[i], defined_core); |
| 330 | changed |= SetRef(cu, ssa_rep->uses[i], defined_ref); |
| 331 | changed |= SetWide(cu, ssa_rep->uses[i], is_wide); |
| 332 | changed |= SetHigh(cu, ssa_rep->uses[i], is_high); |
buzbee | 2a83e8f | 2012-07-13 16:42:30 -0700 | [diff] [blame] | 333 | } |
| 334 | if (attrs & DF_A_WIDE) { |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 335 | DCHECK_EQ(ssa_rep->num_uses, 2); |
| 336 | changed |= SetWide(cu, ssa_rep->uses[1], true); |
| 337 | changed |= SetHigh(cu, ssa_rep->uses[1], true); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 338 | } |
| 339 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 340 | } |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 341 | } |
| 342 | return changed; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 343 | } |
| 344 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 345 | static const char* storage_name[] = {" Frame ", "PhysReg", " Spill "}; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 346 | |
buzbee | 02031b1 | 2012-11-23 09:41:35 -0800 | [diff] [blame] | 347 | static void DumpRegLocTable(CompilationUnit* cu, RegLocation* table, int count) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 348 | { |
buzbee | 02031b1 | 2012-11-23 09:41:35 -0800 | [diff] [blame] | 349 | Codegen* cg = cu->cg.get(); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 350 | for (int i = 0; i < count; i++) { |
buzbee | a169e1d | 2012-12-05 14:26:44 -0800 | [diff] [blame] | 351 | LOG(INFO) << StringPrintf("Loc[%02d] : %s, %c %c %c %c %c %c %c%d %c%d S%d", |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 352 | table[i].orig_sreg, storage_name[table[i].location], |
buzbee | ca7a5e4 | 2012-08-20 11:12:18 -0700 | [diff] [blame] | 353 | table[i].wide ? 'W' : 'N', table[i].defined ? 'D' : 'U', |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 354 | table[i].fp ? 'F' : table[i].ref ? 'R' :'C', |
buzbee | a169e1d | 2012-12-05 14:26:44 -0800 | [diff] [blame] | 355 | table[i].is_const ? 'c' : 'n', |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 356 | table[i].high_word ? 'H' : 'L', table[i].home ? 'h' : 't', |
buzbee | 02031b1 | 2012-11-23 09:41:35 -0800 | [diff] [blame] | 357 | cg->IsFpReg(table[i].low_reg) ? 's' : 'r', |
| 358 | table[i].low_reg & cg->FpRegMask(), |
| 359 | cg->IsFpReg(table[i].high_reg) ? 's' : 'r', |
| 360 | table[i].high_reg & cg->FpRegMask(), table[i].s_reg_low); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 361 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 362 | } |
| 363 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 364 | static const RegLocation fresh_loc = {kLocDalvikFrame, 0, 0, 0, 0, 0, 0, 0, 0, |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 365 | INVALID_REG, INVALID_REG, INVALID_SREG, |
| 366 | INVALID_SREG}; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 367 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 368 | int ComputeFrameSize(CompilationUnit* cu) { |
buzbee | ad8f15e | 2012-06-18 14:49:45 -0700 | [diff] [blame] | 369 | /* Figure out the frame size */ |
| 370 | static const uint32_t kAlignMask = kStackAlignment - 1; |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 371 | uint32_t size = (cu->num_core_spills + cu->num_fp_spills + |
| 372 | 1 /* filler word */ + cu->num_regs + cu->num_outs + |
| 373 | cu->num_compiler_temps + 1 /* cur_method* */) |
buzbee | ad8f15e | 2012-06-18 14:49:45 -0700 | [diff] [blame] | 374 | * sizeof(uint32_t); |
| 375 | /* Align and set */ |
| 376 | return (size + kAlignMask) & ~(kAlignMask); |
| 377 | } |
| 378 | |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 379 | /* |
| 380 | * Simple register allocation. Some Dalvik virtual registers may |
| 381 | * be promoted to physical registers. Most of the work for temp |
Ian Rogers | b5d09b2 | 2012-03-06 22:14:17 -0800 | [diff] [blame] | 382 | * allocation is done on the fly. We also do some initialization and |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 383 | * type inference here. |
| 384 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 385 | void SimpleRegAlloc(CompilationUnit* cu) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 386 | { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 387 | int i; |
| 388 | RegLocation* loc; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 389 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 390 | /* Allocate the location map */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 391 | loc = static_cast<RegLocation*>(NewMem(cu, cu->num_ssa_regs * sizeof(*loc), |
buzbee | cbd6d44 | 2012-11-17 14:11:25 -0800 | [diff] [blame] | 392 | true, kAllocRegAlloc)); |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 393 | for (i=0; i< cu->num_ssa_regs; i++) { |
| 394 | loc[i] = fresh_loc; |
| 395 | loc[i].s_reg_low = i; |
| 396 | loc[i].is_const = IsBitSet(cu->is_constant_v, i); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 397 | } |
| 398 | |
| 399 | /* Patch up the locations for Method* and the compiler temps */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 400 | loc[cu->method_sreg].location = kLocCompilerTemp; |
| 401 | loc[cu->method_sreg].defined = true; |
| 402 | for (i = 0; i < cu->num_compiler_temps; i++) { |
| 403 | CompilerTemp* ct = reinterpret_cast<CompilerTemp*>(cu->compiler_temps.elem_list[i]); |
| 404 | loc[ct->s_reg].location = kLocCompilerTemp; |
| 405 | loc[ct->s_reg].defined = true; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 406 | } |
| 407 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 408 | cu->reg_location = loc; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 409 | |
| 410 | /* Allocation the promotion map */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 411 | int num_regs = cu->num_dalvik_registers; |
| 412 | cu->promotion_map = static_cast<PromotionMap*> |
| 413 | (NewMem(cu, (num_regs + cu->num_compiler_temps + 1) * sizeof(cu->promotion_map[0]), |
buzbee | cbd6d44 | 2012-11-17 14:11:25 -0800 | [diff] [blame] | 414 | true, kAllocRegAlloc)); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 415 | |
| 416 | /* Add types of incoming arguments based on signature */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 417 | int num_ins = cu->num_ins; |
| 418 | if (num_ins > 0) { |
| 419 | int s_reg = num_regs - num_ins; |
| 420 | if ((cu->access_flags & kAccStatic) == 0) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 421 | // For non-static, skip past "this" |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 422 | cu->reg_location[s_reg].defined = true; |
| 423 | cu->reg_location[s_reg].ref = true; |
| 424 | s_reg++; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 425 | } |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 426 | const char* shorty = cu->shorty; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 427 | int shorty_len = strlen(shorty); |
| 428 | for (int i = 1; i < shorty_len; i++) { |
| 429 | switch (shorty[i]) { |
| 430 | case 'D': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 431 | cu->reg_location[s_reg].wide = true; |
| 432 | cu->reg_location[s_reg+1].high_word = true; |
| 433 | cu->reg_location[s_reg+1].fp = true; |
| 434 | DCHECK_EQ(SRegToVReg(cu, s_reg)+1, SRegToVReg(cu, s_reg+1)); |
| 435 | cu->reg_location[s_reg].fp = true; |
| 436 | cu->reg_location[s_reg].defined = true; |
| 437 | s_reg++; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 438 | break; |
| 439 | case 'J': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 440 | cu->reg_location[s_reg].wide = true; |
| 441 | cu->reg_location[s_reg+1].high_word = true; |
| 442 | DCHECK_EQ(SRegToVReg(cu, s_reg)+1, SRegToVReg(cu, s_reg+1)); |
| 443 | cu->reg_location[s_reg].core = true; |
| 444 | cu->reg_location[s_reg].defined = true; |
| 445 | s_reg++; |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 446 | break; |
| 447 | case 'F': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 448 | cu->reg_location[s_reg].fp = true; |
| 449 | cu->reg_location[s_reg].defined = true; |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 450 | break; |
| 451 | case 'L': |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 452 | cu->reg_location[s_reg].ref = true; |
| 453 | cu->reg_location[s_reg].defined = true; |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 454 | break; |
| 455 | default: |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 456 | cu->reg_location[s_reg].core = true; |
| 457 | cu->reg_location[s_reg].defined = true; |
buzbee | d501889 | 2012-07-11 14:23:40 -0700 | [diff] [blame] | 458 | break; |
buzbee | e9a72f6 | 2011-09-04 17:59:07 -0700 | [diff] [blame] | 459 | } |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 460 | s_reg++; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 461 | } |
| 462 | } |
| 463 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 464 | /* Do type & size inference pass */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 465 | DataFlowAnalysisDispatcher(cu, InferTypeAndSize, |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 466 | kPreOrderDFSTraversal, |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 467 | true /* is_iterative */); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 468 | |
| 469 | /* |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 470 | * Set the s_reg_low field to refer to the pre-SSA name of the |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 471 | * base Dalvik virtual register. Once we add a better register |
| 472 | * allocator, remove this remapping. |
| 473 | */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 474 | for (i=0; i < cu->num_ssa_regs; i++) { |
| 475 | if (cu->reg_location[i].location != kLocCompilerTemp) { |
| 476 | int orig_sreg = cu->reg_location[i].s_reg_low; |
| 477 | cu->reg_location[i].orig_sreg = orig_sreg; |
| 478 | cu->reg_location[i].s_reg_low = SRegToVReg(cu, orig_sreg); |
buzbee | e9a72f6 | 2011-09-04 17:59:07 -0700 | [diff] [blame] | 479 | } |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 480 | } |
buzbee | e9a72f6 | 2011-09-04 17:59:07 -0700 | [diff] [blame] | 481 | |
buzbee | 4ef3e45 | 2012-12-14 13:35:28 -0800 | [diff] [blame] | 482 | /* |
| 483 | * Now that everything is typed and constants propagated, identify those constants |
| 484 | * that can be cheaply materialized and don't need to be flushed to a home location. |
| 485 | * The default is to not flush, and some have already been marked as must flush. |
| 486 | */ |
| 487 | for (i=0; i < cu->num_ssa_regs; i++) { |
| 488 | if (IsBitSet(cu->is_constant_v, i)) { |
| 489 | bool flush = false; |
| 490 | RegLocation loc = cu->reg_location[i]; |
| 491 | if (loc.wide) { |
| 492 | int64_t value = ConstantValueWide(cu, loc); |
| 493 | if (loc.fp) { |
| 494 | flush = !cu->cg->InexpensiveConstantDouble(value); |
| 495 | } else { |
| 496 | flush = !cu->cg->InexpensiveConstantLong(value); |
| 497 | } |
| 498 | } else { |
| 499 | int32_t value = ConstantValue(cu, loc); |
| 500 | if (loc.fp) { |
| 501 | flush = !cu->cg->InexpensiveConstantFloat(value); |
| 502 | } else { |
| 503 | flush = !cu->cg->InexpensiveConstantInt(value); |
| 504 | } |
| 505 | } |
| 506 | if (flush) { |
| 507 | SetBit(cu, cu->must_flush_constant_v, i); |
| 508 | } |
| 509 | if (loc.wide) { |
| 510 | i++; // Skip the high word |
| 511 | } |
| 512 | } |
| 513 | } |
| 514 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 515 | cu->core_spill_mask = 0; |
| 516 | cu->fp_spill_mask = 0; |
| 517 | cu->num_core_spills = 0; |
buzbee | c0ecd65 | 2011-09-25 18:11:54 -0700 | [diff] [blame] | 518 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 519 | DoPromotion(cu); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 520 | |
buzbee | ad8f15e | 2012-06-18 14:49:45 -0700 | [diff] [blame] | 521 | /* Get easily-accessable post-promotion copy of RegLocation for Method* */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 522 | cu->method_loc = cu->reg_location[cu->method_sreg]; |
buzbee | ad8f15e | 2012-06-18 14:49:45 -0700 | [diff] [blame] | 523 | |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 524 | if (cu->verbose && !(cu->disable_opt & (1 << kPromoteRegs))) { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 525 | LOG(INFO) << "After Promotion"; |
buzbee | 02031b1 | 2012-11-23 09:41:35 -0800 | [diff] [blame] | 526 | DumpRegLocTable(cu, cu->reg_location, cu->num_ssa_regs); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 527 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 528 | |
buzbee | ad8f15e | 2012-06-18 14:49:45 -0700 | [diff] [blame] | 529 | /* Set the frame size */ |
buzbee | fa57c47 | 2012-11-21 12:06:18 -0800 | [diff] [blame] | 530 | cu->frame_size = ComputeFrameSize(cu); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 531 | } |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 532 | |
| 533 | } // namespace art |