elastic_trace.cc (12106:7784fac1b159) | elastic_trace.cc (12255:9ef9176e4bb2) |
---|---|
1/* 2 * Copyright (c) 2013 - 2015 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 224 unchanged lines hidden (view full) --- 233 InstExecInfo* exec_info_ptr = new InstExecInfo; 234 tempStore[seq_num] = exec_info_ptr; 235 236 // Loop through the source registers and look up the dependency map. If 237 // the source register entry is found in the dependency map, add a 238 // dependency on the last writer. 239 int8_t max_regs = dyn_inst->numSrcRegs(); 240 for (int src_idx = 0; src_idx < max_regs; src_idx++) { | 1/* 2 * Copyright (c) 2013 - 2015 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 224 unchanged lines hidden (view full) --- 233 InstExecInfo* exec_info_ptr = new InstExecInfo; 234 tempStore[seq_num] = exec_info_ptr; 235 236 // Loop through the source registers and look up the dependency map. If 237 // the source register entry is found in the dependency map, add a 238 // dependency on the last writer. 239 int8_t max_regs = dyn_inst->numSrcRegs(); 240 for (int src_idx = 0; src_idx < max_regs; src_idx++) { |
241 // Get the physical register index of the i'th source register. 242 PhysRegIdPtr src_reg = dyn_inst->renamedSrcRegIdx(src_idx); 243 DPRINTFR(ElasticTrace, "[sn:%lli] Check map for src reg" 244 " %i (%s)\n", seq_num, 245 src_reg->index(), src_reg->className()); 246 auto itr_last_writer = physRegDepMap.find(src_reg->flatIndex()); 247 if (itr_last_writer != physRegDepMap.end()) { 248 InstSeqNum last_writer = itr_last_writer->second; 249 // Additionally the dependency distance is kept less than the window 250 // size parameter to limit the memory allocation to nodes in the 251 // graph. If the window were tending to infinite we would have to 252 // load a large number of node objects during replay. 253 if (seq_num - last_writer < depWindowSize) { 254 // Record a physical register dependency. 255 exec_info_ptr->physRegDepSet.insert(last_writer); | 241 242 const RegId& src_reg = dyn_inst->srcRegIdx(src_idx); 243 if (!src_reg.isMiscReg() && 244 !src_reg.isZeroReg()) { 245 // Get the physical register index of the i'th source register. 246 PhysRegIdPtr phys_src_reg = dyn_inst->renamedSrcRegIdx(src_idx); 247 DPRINTFR(ElasticTrace, "[sn:%lli] Check map for src reg" 248 " %i (%s)\n", seq_num, 249 phys_src_reg->flatIndex(), phys_src_reg->className()); 250 auto itr_writer = physRegDepMap.find(phys_src_reg->flatIndex()); 251 if (itr_writer != physRegDepMap.end()) { 252 InstSeqNum last_writer = itr_writer->second; 253 // Additionally the dependency distance is kept less than the 254 // window size parameter to limit the memory allocation to 255 // nodes in the graph. If the window were tending to infinite 256 // we would have to load a large number of node objects during 257 // replay. 258 if (seq_num - last_writer < depWindowSize) { 259 // Record a physical register dependency. 260 exec_info_ptr->physRegDepSet.insert(last_writer); 261 } |
256 } | 262 } |
263 |
|
257 } | 264 } |
265 |
|
258 } 259 260 // Loop through the destination registers of this instruction and update 261 // the physical register dependency map for last writers to registers. 262 max_regs = dyn_inst->numDestRegs(); 263 for (int dest_idx = 0; dest_idx < max_regs; dest_idx++) { 264 // For data dependency tracking the register must be an int, float or 265 // CC register and not a Misc register. 266 const RegId& dest_reg = dyn_inst->destRegIdx(dest_idx); 267 if (!dest_reg.isMiscReg() && 268 !dest_reg.isZeroReg()) { 269 // Get the physical register index of the i'th destination 270 // register. 271 PhysRegIdPtr phys_dest_reg = dyn_inst->renamedDestRegIdx(dest_idx); 272 DPRINTFR(ElasticTrace, "[sn:%lli] Update map for dest reg" | 266 } 267 268 // Loop through the destination registers of this instruction and update 269 // the physical register dependency map for last writers to registers. 270 max_regs = dyn_inst->numDestRegs(); 271 for (int dest_idx = 0; dest_idx < max_regs; dest_idx++) { 272 // For data dependency tracking the register must be an int, float or 273 // CC register and not a Misc register. 274 const RegId& dest_reg = dyn_inst->destRegIdx(dest_idx); 275 if (!dest_reg.isMiscReg() && 276 !dest_reg.isZeroReg()) { 277 // Get the physical register index of the i'th destination 278 // register. 279 PhysRegIdPtr phys_dest_reg = dyn_inst->renamedDestRegIdx(dest_idx); 280 DPRINTFR(ElasticTrace, "[sn:%lli] Update map for dest reg" |
273 " %i (%s)\n", seq_num, dest_reg.index(), | 281 " %i (%s)\n", seq_num, phys_dest_reg->flatIndex(), |
274 dest_reg.className()); 275 physRegDepMap[phys_dest_reg->flatIndex()] = seq_num; 276 } 277 } 278 maxPhysRegDepMapSize = std::max(physRegDepMap.size(), 279 (std::size_t)maxPhysRegDepMapSize.value()); 280} 281 --- 673 unchanged lines hidden --- | 282 dest_reg.className()); 283 physRegDepMap[phys_dest_reg->flatIndex()] = seq_num; 284 } 285 } 286 maxPhysRegDepMapSize = std::max(physRegDepMap.size(), 287 (std::size_t)maxPhysRegDepMapSize.value()); 288} 289 --- 673 unchanged lines hidden --- |