[LLVMdev] Metadata in the backend

Nadav Rotem nrotem at apple.com
Thu Aug 8 09:56:07 PDT 2013


Hi Alon, 

There is no good mapping between IR-level instructions and MachineInstructions because we don’t do a 1:1 translation. We delete instructions and create new ones. Some of the memory operations hold references to the original IR pointer, but we drop this information in many places. We also delete or generate new basic blocks, so you can’t rely on that. However, from the MachineFunction you can access the original IR and access some metadata (which you can place on the terminator of the first basic block of something).  I am not sure how much information you want to communicate between the IR-level passes and the backend, but you can introduce new intrinsics that can be lowered to pseudo instructions.

Thanks,
Nadav  

On Aug 8, 2013, at 5:30 AM, Alon Shaltiel (ashaltie) <ashaltie at cisco.com> wrote:

> Hi all,
> I'm looking for a way to insert metadata into an instruction/function/basic-block in the IR level, and afterwards reading it in the backend (ARM to be exact).
>  
> So my questions are:
> 1.       Does/can the metadata in the IR survive the code-generator in some way?
> 2.       Is there a general of ‘communication’ between the optimizer and the backend?
>  
> Thanks!
> Alon
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/dada12b0/attachment.html>


More information about the llvm-dev mailing list