[llvm-dev] Adding support for self-modifying branches to LLVM?

Jonas Wagner via llvm-dev
Thu, 21 Jan 2016 13:04:56 -0000

Hi,

Your initial idea (compile with branches, then convert to nops) won't
truly
> be zero-overhead because that still requires having the instrumentation
> present in the IR, which inhibits optimization. Actually, for UBSan I think
> this is the primary mechanism by which it "slows code down".
>

This is very interesting! Do you know of any studies that measure this kind
of effect?

Also, for sanitizers that use shadow, they really "want"
instrumentation to
> be enabled "everywhere".
>

There is some data on this, e.g, in "High System-Code Security with Low
Overhead" <http://dslab.epfl.ch/proj/asap/#publications>. In this
work we
found that, for ASan as well as other instrumentation tools, most overhead
comes from the checks. Especially for CPU-intensive applications, the cost
of maintaining shadow memory is small.

I'm happy to discuss this further. Also, if there are more suggestions on
how to best implement this, let me know!

- Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20160121/b04039cd/attachment.html>