[LLVMdev] Metadata for MachineInstr

Zeng Bin ezengbin at gmail.com
Fri Apr 6 07:23:12 PDT 2012


On Thu, Apr 5, 2012 at 9:00 AM, Zeng Bin <ezengbin at gmail.com> wrote:

> Hi all,
>
> Just a quick question about passing information all the way down to
> machine code level. Metadata provides an excellent vehicle to pass extra
> ad-hoc information along the compilation pipeline. However, If I understand
> correctly, it seems that MachineInstr does not support metadata, by which I
> mean metadata cannot be attached to MachineInstr's by now. Metadata can be
> bundled with Instruction class instances. The metadata attached to
> Instruction gets lost during code generation. Here is my question, is there
> a way to pass information attached to Instruction even further down to
> stages after code generation? NamedMetadata is a good example but it seems
> that it cannot be attached to Instruction or MachineInstr if I understand
> correctly. Is there something like DebugLoc which gets preserved all the
> way but more general than DebugLoc?
>
> Thank you in advance.
> -Bin
>

It seems that adding a pointer-typed field to NamedMetadata into DebugLoc
does not work when the pointer is serialized and deserialized in a .bc
file. Is there a way to add a field into DebugLoc such that it can be
serialized and deserialized?

Thanks!
-Bin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120406/b36a0474/attachment.html>


More information about the llvm-dev mailing list