<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 3, 2015 at 4:13 PM, Peter Collingbourne <span dir="ltr"><<a href="mailto:peter@pcc.me.uk" target="_blank">peter@pcc.me.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Feb 03, 2015 at 04:03:45PM -0800, Sean Silva wrote:<br>
> One other thing: if this can be used for control-flow integrity, I assume<br>
> it has to have good knowledge of the available indirect call targets. Could<br>
> we also use this information for devirtualization?<br>
<br>
</span>I would expect so. If a bitset contains only one element, we should be able<br>
to teach the lowering pass to simply test that the given pointer is equal<br>
to that element (i.e. the only valid vptr). If the later IR branches to a<br>
trapping block if that condition is false, it should be possible for the<br>
optimizer to deduce that the condition is true in any code that is dominated<br>
by the branch, and from that do devirtualization.<br></blockquote><div><br></div><div><br></div><div>Well, I was wondering about for devirtualization without necessarily needing any of the CFI stuff. We should probably aim for a design that provides a primitive that can satisfy the needs of both CFI and devirtualization.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Peter<br>
</font></span></blockquote></div><br></div></div>