[LLVMdev] IR extension proposal: bitset constants

Peter Collingbourne
Wed, 04 Feb 2015 00:13:33 -0000

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.

Thanks,
--
Peter