[llvm-dev] Prevent LLVM optimizations from erasing unused basic blocks

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 9 13:58:25 PDT 2018


On Tue, Oct 9, 2018 at 11:32 AM Gleb Popov via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Note that I can't use global variables for a reason, so the data has to be
> encoded in a BB using inline assembly.
>

Can you elaborate on why you've discarded this idea? There are tons of ways
to put metadata in a global and then associate it with the function. The
inline assembly snippets you pasted suggest that the contents are just data
in some non-text section, they don't use any values from the function. What
you're doing sounds a lot like coverage mapping data, instrprof data, asan
global metadata, or exception handling data. Those features all have
different ways to put stuff in global variables on the side and get them
emitted into different sections as appropriate.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181009/fef56cd8/attachment.html>


More information about the llvm-dev mailing list