[llvm-dev] Address of instruction in codegen

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 24 11:37:58 PDT 2021


On Wed, Jun 23, 2021 at 12:23 PM Krzysztof Parzyszek via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Check if MachineInstr::[sg]etPreInstrSymbol do what you need.
>

I have generated enough awareness of this API that other people mention it
now. Success. :)

A word of caution: depending on where you are in codegen, there are late
passes that can delete or duplicate MachineInstrs (tail duplication comes
to mind). You need to be reasonably confident that the annotated
instruction won't be affected by such passes, or you will get errors from
the assembler about an undefined label or duplicate label definitions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210624/495b5ad0/attachment.html>


More information about the llvm-dev mailing list