Pedro Lopes via llvm-dev
2018-Feb-04 20:12 UTC
[llvm-dev] Developing a pass for the backend
Hi, Is there a way to map a MachineInstr to the respective LLVM IR using a MachineFunctionPass (or something else) in my backend? I need to read some metadata associated with LLVM IR instructions and I was thinking of using some debug information (DebugLoc?) to do so. However, By inspecting the LLVM source code I have not been able to find any mapping between a MachineInstr and a LLVM IR Instruction. Thanks, Tiago
See if this thread http://lists.llvm.org/pipermail/llvm-dev/2017-November/119274.html help. 2018-02-05 4:12 GMT+08:00 Pedro Lopes via llvm-dev <llvm-dev at lists.llvm.org> :> Hi, > > Is there a way to map a MachineInstr to the respective LLVM IR using a > MachineFunctionPass (or something else) in my backend? > > I need to read some metadata associated with LLVM IR instructions and > I was thinking of using some debug information (DebugLoc?) to do so. > However, By inspecting the LLVM source code I have not been able to > find any mapping between a MachineInstr and a LLVM IR Instruction. > > Thanks, > Tiago > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Wei-Ren Chen (陳韋任) Homepage: https://people.cs.nctu.edu.tw/~chenwj -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180205/392712c8/attachment.html>
Pedro Lopes via llvm-dev
2018-Feb-13 12:41 UTC
[llvm-dev] Developing a pass for the backend
Hello, Unfortunately, I think it does not help. I need a complete mapping from IR (class Instruction) to MachineInstr (?). I need to know, for a specific IR instruction, which assembly instructions are generated. I think that post doesn't go that far as I believe MachineInstr have no connection to the SelectionDAG. Tiago 2018-02-05 13:45 GMT+01:00 陳韋任 <chenwj.cs97g at g2.nctu.edu.tw>:> See if this thread > http://lists.llvm.org/pipermail/llvm-dev/2017-November/119274.html help. > > 2018-02-05 4:12 GMT+08:00 Pedro Lopes via llvm-dev > <llvm-dev at lists.llvm.org>: >> >> Hi, >> >> Is there a way to map a MachineInstr to the respective LLVM IR using a >> MachineFunctionPass (or something else) in my backend? >> >> I need to read some metadata associated with LLVM IR instructions and >> I was thinking of using some debug information (DebugLoc?) to do so. >> However, By inspecting the LLVM source code I have not been able to >> find any mapping between a MachineInstr and a LLVM IR Instruction. >> >> Thanks, >> Tiago >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > > > > > -- > Wei-Ren Chen (陳韋任) > Homepage: https://people.cs.nctu.edu.tw/~chenwj