[llvm-dev] [RFC] A new intrinsic, `llvm.blackbox`, to explicitly prevent constprop, die, etc optimizations

Daniel Berlin via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 11 13:15:45 PST 2015


>
>
>
> Reid's explanation of "an external function that LLVM is not allowed to
> reason about the body of" is a much better explanation, as a good
> benchmark will place llvm.blackbox() exactly where real code would call,
> say, getrandom() (on input) or printf() (on output).
>


> However, as the function call overhead of said external function isn't
> part of the _developer's_ code,


This isn't call overhead though.
It's a conditional and two calls someone wrote in some benchmark code.
That's not call overhead ;-)

It's just that i've proven the condition has no side effects and doesn't
matter, so i eliminated it.

Thus, I'm trying to ask the question: "Will the use case really still be
served if we let us eliminate these conditionals as useless, when the whole
point is to let people test the overhead of things the compiler wanted to
eliminate because it thinks they are useless"
;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151111/64cb38b4/attachment.html>


More information about the llvm-dev mailing list