<html><head></head><body><div>Hi,</div><div><br></div><div>I'm trying to delete a redundant instruction (machine Non-SSA) and I'm having trouble updating the live ranges.</div><div><br></div><div>Consider the example,</div><div><span><div>bb.191 (%ir-block.1008):</div><div>; predecessors: %bb.183, %bb.188, %bb.190</div><div>  successors: %bb.192(0x50000000), %bb.194(0x30000000); %bb.192(62.50%), %bb.194(37.50%)</div><div>  ...</div><div>  %231:fr64 = FsFLD0SD<br></div><div>  JLE_1 %bb.194, implicit killed $eflags</div><div>  JMP_1 %bb.192</div><div><br></div><div>bb.192 (%ir-block.1023):</div><div>; predecessors: %bb.191</div><div>  successors: %bb.193(0x80000000); %bb.193(100.00%)</div><div><br></div><div>  ...</div><div>  %231:fr64 = FsFLD0SD</div><div>  ...  </div><div><br></div><div><br></div><div>bb.193 (%ir-block.1024):</div><div>; predecessors: %bb.192, %bb.193</div><div>  successors: %bb.194(0x04000000), %bb.193(0x7c000000); %bb.194(3.12%), %bb.193(96.88%)</div><div><br></div><div>  ....</div><div>  %231:fr64 = nnan ninf nsz arcp contract afn reassoc VADDSDrr %231:fr64(tied-def 0), %1270:fr64, %1269:fr64</div><div>  ....</div><div><br></div><div><br></div><div>The definition for virtual register (%231) in bb.192 is redundant as the same instruction is present in bb.191.</div><div>I want to delete the redundant instruction in bb.192 so that all the uses of this definition, now point to the definition in bb.191.</div><div>How to update the Live Ranges in this case?</div><div>The redundancy is evident only during the Register Coalescing and hence my fix includes marking the instruction in bb.192 as dead and then deleting it.</div><div>I was expecting that the API "eliminateDeadDefs" in LiveRangeUpdater would handle updating the live ranges, but apparently something is wrong.</div><div>Probably "eliminateDeadDefs" is not intended for this purpose.</div><div>I was not able to find any other API which would tell me that the uses of deleted instruction (in bb.192) will now use the definition in bb.191.</div><div>Any pointers/solutions would be really helpful.</div><div><br></div><div>Thanks,</div><div>Abhilash</div><div><br></div></span></div><div class="ydpe1ba7f7byahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"></div></body></html>