[LLVMdev] IR extension proposal: bitset constants
Sean Silva
chisophugis at gmail.com
Tue Feb 3 16:26:16 PST 2015
On Tue, Feb 3, 2015 at 4:13 PM, Peter Collingbourne <peter at pcc.me.uk> wrote:
> On Tue, Feb 03, 2015 at 04:03:45PM -0800, Sean Silva wrote:
> > One other thing: if this can be used for control-flow integrity, I assume
> > it has to have good knowledge of the available indirect call targets.
> Could
> > we also use this information for devirtualization?
>
> I would expect so. If a bitset contains only one element, we should be able
> to teach the lowering pass to simply test that the given pointer is equal
> to that element (i.e. the only valid vptr). If the later IR branches to a
> trapping block if that condition is false, it should be possible for the
> optimizer to deduce that the condition is true in any code that is
> dominated
> by the branch, and from that do devirtualization.
>
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.
-- Sean Silva
>
> Thanks,
> --
> Peter
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150203/3caf61e3/attachment.html>
More information about the llvm-dev
mailing list