<div dir="ltr">I made the change to the BuildMI() call. Again, I don't think that matters.<div><br></div><div><div>#define BUILD_INS(opcode, new_reg, i)                               \</div><div>  BuildMI(*MBB, OldMI, MBBI->getDebugLoc(), TII->get(X86::opcode))  \</div><div>    .addReg(X86::new_reg, kill).addImm(i)</div></div><div><br></div><div>I didn't completely understand your other proposed change:</div>​<div><span class="im" style="font-size:12.8000001907349px">    for (MachineBasicBlock::iterator MBBI = MBB->begin();<br></span><span style="font-size:12.8000001907349px">        MBBI != MBB->end(); ) {</span><br style="font-size:12.8000001907349px"><span class="im" style="font-size:12.8000001907349px">      MachineInstr *NewMI = NULL;<br>      OldMI = MBBI;<br></span><span style="font-size:12.8000001907349px">      ++MBBI;</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">I think you're saying with </span><span style="font-size:12.8000001907349px">++MBBI</span><span style="font-size:12.8000001907349px"> to step past the old instruction.</span></div><div><span style="font-size:12.8000001907349px">This seems faster speedwise but more of a hack than just restarting the loop.</span></div><div><span style="font-size:12.8000001907349px">But I'll try it. It implies a certain knowledge of the iterator and MBB.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">I accidentally touched MachineInstr.h and the rebuild is extracting its punishment.</span></div></div>