<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 30, 2014, at 4:02 PM, Johannes Doerfert <<a href="mailto:doerfert@cs.uni-saarland.de" class="">doerfert@cs.uni-saarland.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">In splitCriticalEdges, if LoopInfo is available you can use it. Otherwise you can use the DomTree. If the DomTree check fails (ie. both targets dominate the latch) then just invalidate the metadata.<br class=""></blockquote><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I could update my patch if we decide to go this way. It would probably require the least change outside the actual SplitCriticalEdge function.</span></div></blockquote></div><br class=""><div class="">It would be nice to add logic to SplitCritical edge to handle the situation where we have a DomTree but no LoopInfo. That way GVN does not need to require LoopInfo. But it may be a little tricky.</div><div class=""><br class=""></div><div class="">Instead of directly checking for a loop header, you would be checking whether the branch target dominates the branch block. Unfortunately, you’ll have trouble with nested loops. You would have to check both targets of the loop exit block. If only one dominates the exit block it’s easy. If both dominate the exit block then one will dominate the other, with the latter being the current inner loop. Note that this is not a general way to find the current loop header, but should work in the case of splitting a single critical edge where we know that the loop exit block was formerly the loop latch (i.e. it MUST branch directly to the loop header before splitting).</div><div class=""><br class=""></div><div class="">-Andy</div></body></html>