<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 13, 2018 at 2:04 PM, Alina Sbirlea <span dir="ltr"><<a href="mailto:alina.sbirlea@gmail.com" target="_blank">alina.sbirlea@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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/<wbr>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></div></blockquote><div><br></div><div>I can't comment on whether there are two methods, but I wanted to merge them myself at some point (although other priorities showed up).</div><div>I think we should keep the more general version and it should preserve the analyses.</div><div><br></div><div>Thanks,</div><div><br></div><div>--</div><div>Davide </div></div></div></div>