<div dir="ltr">Sent out: <a href="https://reviews.llvm.org/D48202" rel="noreferrer" target="_blank" style="color:rgb(17,85,204);font-family:sans-serif">https://reviews.llvm.org/D4820<wbr>2</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 13, 2018 at 2:19 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">Let me add one more specific question.<div>One method returns (does nothing) if BB.hasAddressTaken, while the other replaces the block address with constant 1? I have zero background of the usecase for the latter, so comments welcome.</div><div><br></div><div>I do agree with having a general version, they each have some functionality the other does not, so the merge would be a superset of the two updating all analyses when available.</div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 13, 2018 at 2:09 PM, Davide Italiano <span dir="ltr"><<a href="mailto:dccitaliano@gmail.com" target="_blank">dccitaliano@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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>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/BasicBloc<wbr>kUtils.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></span><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>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>