[llvm-dev] MDNode equivalent in backend?

via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 16 10:57:00 PDT 2018


I suspect the instruction-level annotations that exist (such as source location) are the ones that people needed in order to get something done.  If you want to do something new, you will likely need a new kind of annotation.
Obviously the debug-info metadata survives through code generation, so you could use that as a model.  One caution: preserving the debug info requires a lot of attention from the optimization passes (we have loads of bugs in this department) so it seems quite likely that a new kind of annotation would require similar attention.
--paulr

From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Son Tuan VU via llvm-dev
Sent: Friday, July 13, 2018 4:24 PM
To: llvm-dev
Subject: [llvm-dev] MDNode equivalent in backend?

Hi all,
Let's say I want to annotate a C statement, let it be the simplest assignment `int i = 3`. At the IR, this is straightforward as we can attach a MDNode to the IR instruction representing the assignment. But I need to be able to propagate the annotation to the binary ELF file. AFAIK, there is no mechanism to do so in the backend. Is there any particular reason to not support some sort of MIR annotation in the backend? Or is it purely because of manpower?
Thank you for your advice

Son Tuan Vu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180716/a50e923c/attachment.html>


More information about the llvm-dev mailing list