<div dir="ltr"><div><font face="sans-serif">Hi,</font></div><div><font face="sans-serif"><br></font></div><div><font face="sans-serif">I'm looking to see what's the best way to solve the fact that these two utils mostly do the same thing:</font></div><span style="font-family:sans-serif;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">1. lib/Transforms/Utils/Local.cpp : </span><span style="font-family:sans-serif;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">MergeBasicBlockIntoOnlyPred</span><br style="font-family:sans-serif;text-decoration-style:initial;text-decoration-color:initial"><span style="font-family:sans-serif;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">2. lib/Transforms/Utils/BasicBlockUtils.cpp : </span><span style="font-family:sans-serif;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">MergeBlockIntoPredecessor</span><div><font face="sans-serif">(+cc some of the folks who touched at least one of these either originally or recently)<br></font><div><span style="font-family:sans-serif;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="font-family:sans-serif;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Brief overview:</span></div><div><table cellspacing="0" cellpadding="0" dir="ltr" border="1" style="table-layout:fixed;font-size:10pt;font-family:arial,sans,sans-serif;width:0px;border-collapse:collapse;border:none"><colgroup><col width="244"><col width="234"></colgroup><tbody><tr style="height:21px"><td style="border-width:1px 1px 2px;border-style:solid;border-color:rgb(204,204,204) rgb(204,204,204) rgb(0,0,0);overflow:hidden;padding:2px 3px;vertical-align:bottom;background-color:rgb(255,255,255);font-family:sans-serif;font-weight:normal;white-space:normal;word-wrap:break-word;color:rgb(34,34,34)">1. MergeBasicBlockIntoOnlyPred</td><td style="border-width:1px 1px 2px;border-style:solid;border-color:rgb(204,204,204) rgb(204,204,204) rgb(0,0,0);overflow:hidden;padding:2px 3px;vertical-align:bottom;background-color:rgb(255,255,255);font-family:sans-serif;font-weight:normal;white-space:normal;word-wrap:break-word;color:rgb(34,34,34)">2. MergeBlockIntoPredecessor</td></tr><tr style="height:21px"><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;white-space:normal;word-wrap:break-word;border:1px solid rgb(204,204,204)">Update DT</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;white-space:normal;word-wrap:break-word;border:1px solid rgb(204,204,204)">Update DT</td></tr><tr style="height:21px"><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;white-space:normal;word-wrap:break-word;border:1px solid rgb(204,204,204)">Update either DT or DDT</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;background-color:rgb(255,255,255);font-family:arial;font-weight:normal;white-space:normal;word-wrap:break-word;color:rgb(34,34,34);border:1px solid rgb(204,204,204)">Updates LI and MemoryDependenceResults</td></tr><tr style="height:21px"><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;white-space:normal;word-wrap:break-word;border:1px solid rgb(204,204,204)">Move all instructions from Pred to BB, delete Pred</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;white-space:normal;word-wrap:break-word;border:1px solid rgb(204,204,204)">Move all instruction from BB to Pred, delete BB</td></tr><tr style="height:21px"><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;white-space:normal;word-wrap:break-word;border:1px solid rgb(204,204,204)">assert BB has single predecessor</td><td style="overflow:hidden;padding:2px 3px;vertical-align:bottom;white-space:normal;word-wrap:break-word;border:1px solid rgb(204,204,204)">return if BB doesn't have a single predecessor</td></tr></tbody></table><br></div><div><br></div><div>Can I get some background on why there are two methods with such similar functionality?</div><div><br></div><div>Are folks ok with merging them into one?</div><div><br></div><div>If against merging, can we at least have both move instructions into the same direction (perhaps into Pred according to both function names)?</div><div><br></div><div>Please let me know your thoughts/preferences. I'd like to send up a cleanup patch soon for this.</div><div><br></div><div>Thanks,</div><div>Alina</div><div><font face="sans-serif">
</font></div></div></div>