shruti padmanabha
2014-May-17 21:05 UTC
[LLVMdev] Associate IR instruction with corresponding assembly
Hi, Is there a way to associate LLVM IR instructions with the instructions they finally generate in the assembly file emitted by LLC? I need to track the PC's corresponding to certain IR level instructions for ARM. One way to do this is to tag an IR instruction with a special flag and pass that flag onto the Machine IR created by LLC and then onto Machine Code. It would be helpful if I could get some pointers on how to do this. Thanks in advance, Shruti Padmanabha University of Michigan, Ann Arbor -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140517/642e61d1/attachment.html>
Tobias Grosser
2014-May-17 21:57 UTC
[LLVMdev] Associate IR instruction with corresponding assembly
On 17/05/2014 23:05, shruti padmanabha wrote:> Hi, > > Is there a way to associate LLVM IR instructions with the instructions they > finally generate in the assembly file emitted by LLC? I need to track the > PC's corresponding to certain IR level instructions for ARM. > One way to do this is to tag an IR instruction with a special flag and pass > that flag onto the Machine IR created by LLC and then onto Machine Code. It > would be helpful if I could get some pointers on how to do this.You may want to look at the -debug-ir pass, which creates METADATA to emit debugging information that allows you to associate machine instructions with IR instructions. This may or may not be what you want. Tobias
shruti padmanabha
2014-May-18 22:54 UTC
[LLVMdev] Associate IR instruction with corresponding assembly
Hi, Thanks for the pointer. I am unfortunately running into llc problems with this pass. I did *opt -debug-ir hello.bc -o hello.deb.bc* *llc -march=arm -debug -O0 hello.deb.bc -o hello.deb.s* This is aborting with the error: llc: llvm-3.4/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1614: void llvm::DwarfDebug::beginFunction(const llvm::MachineFunction*): Assertion `TheCU && "Unable to find compile unit!"' failed. I'm assuming this is because llc found some errors in the metadata that debug-ir prints out. How do I find and correct this? Thanks again, Shruti On Sat, May 17, 2014 at 5:57 PM, Tobias Grosser <tobias at grosser.es> wrote:> On 17/05/2014 23:05, shruti padmanabha wrote: > >> Hi, >> >> Is there a way to associate LLVM IR instructions with the instructions >> they >> finally generate in the assembly file emitted by LLC? I need to track the >> PC's corresponding to certain IR level instructions for ARM. >> One way to do this is to tag an IR instruction with a special flag and >> pass >> that flag onto the Machine IR created by LLC and then onto Machine Code. >> It >> would be helpful if I could get some pointers on how to do this. >> > > You may want to look at the -debug-ir pass, which creates METADATA to emit > debugging information that allows you to associate machine instructions > with IR instructions. This may or may not be what you want. > > Tobias >-- Shruti Padmanabha University of Michigan, Ann Arbor -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140518/36779ef6/attachment.html>
Possibly Parallel Threads
- [LLVMdev] Associate IR instruction with corresponding assembly
- [LLVMdev] Associate IR instruction with corresponding assembly
- [LLVMdev] Associate IR instruction with corresponding assembly
- [LLVMdev] Associate IR instruction with corresponding assembly
- [LLVMdev] DwarfDebug problems