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

Gleb Popov via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 9 13:53:02 PDT 2018


On Tue, Oct 9, 2018 at 11:42 PM Tim Northover <t.p.northover at gmail.com>
wrote:

> On Tue, 9 Oct 2018 at 21:03, Gleb Popov via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > Won't @llvm.returnaddress() always get me correct location of my inline
> asm block?
>
> Why would it? That's the address of the callee and there's no reason
> it should correlate with anything whatsoever in the current function.
>

Right, I just confused it with blockaddress constant.

Before now it sounded like you were using that as some way to trick
> LLVM into keeping your block around, which would have no effect on its
> position.
>

That's correct, I used returnaddress to trick optimizer and blockaddress to
actually get a pointer to my data inside the function. Sorry for mixing it
up.


> Cheers.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181009/e7aefb1a/attachment.html>


More information about the llvm-dev mailing list