<div class="gmail_quote">On 11 October 2011 02:11, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi David,<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
It's really close, but not quite. Given the attached llvm assembly, the function<br>
call is correctly devirtualized (but the branch is left in). But if you comment<br></div>
out the first ret void (in the <a href="http://vtable.ne" target="_blank">vtable.ne</a> <<a href="http://vtable.ne" target="_blank">http://vtable.ne</a>> block) & comment in<div class="im"><br>
the unreachable instruction then the branch is removed by the simplifycfg pass &<br>
no interesting information about the condition is preserved for use by the GVN<br>
pass so the call is still indirect/virtual.<br>
</div></blockquote>
<br>
I thought there was a plan that a branch to a block containing only unreachable<br>
shouldn't be removed by the IR optimizers (instead codegen would remove it).  I<br>
even though Nick implemented this.  But apparently not...<br></blockquote><div><br></div><div>Implemented but never committed. It had a lot of undesirable side-effects in terms of preventing other optimizations from happening.</div>

<div><br></div><div>Nick</div><div><br></div></div>