[llvm-dev] Adding support for self-modifying branches to LLVM?
Jonas Wagner via llvm-dev
llvm-dev at lists.llvm.org
Thu Jan 21 14:52:03 PST 2016
Hello,
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.
How did you measure this? If it was measured by removing the checks before
optimization happens, then what you may have been measuring is not the
execution overhead of the branches (which is what would be eliminated by
nop’ing them out) but the effect on the optimizer.
Interesting. Indeed this was measured by removing some checks and then
re-optimizing the program.
I’m aware of some impact checks may have on optimization. For example, I’ve
seen cases where much less inlining happens because functions with checks
are larger. Do you know other concrete examples? This is definitely
something I’ll have to be careful about. Philip Reames confirms this, too.
On the other hand, we’ve also found that the benefit from removing a check
is roughly proportional to the number of cycles spent executing that
check’s instructions. Our model of this is not very precise, but it shows
that the cost of executing the check’s instructions matters.
I'll try to measure this, and will come back when I have data.
Best,
Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160121/7fcaa87a/attachment.html>
More information about the llvm-dev
mailing list