<div dir="ltr">Hello everybody,<br><br>as the title says i'm writing a MachinePass that's runs just before the register rewriter.<br>What this pass should do is to replace (when a specific condition holds) the physical register assigned to a virtual register with a new physical register. <br>This condition doesn't hold "too many times", and usually changing the mapping once is enough.<br>After reading some of the register allocators code i've been able to write this (c++ish):<br><div>for NewPhysReg in AllocationOrder:</div><div><div>        if (NewPhysReg == PrevPhysReg)</div><div>          continue;</div></div><div><br></div><div>        if(Matrix->checkInterference(VirtRegInterval, NewPhysReg) == LiveRegMatrix::IK_Free)<br></div><div>           VRM->clearVirt(VirtReg);</div><div>           Matrix->assign(VirtRegInterval, NewPhysReg);</div><div>           </div><br>The problem now is: what should i do when all the "new" physical register have some interference? <br><br>Any help is very appreciated!      <br><br></div>