[LLVMdev] LLVM Instr from MachineInstr

ankur deshwal a.s.deshwal at gmail.com
Fri Jul 1 09:09:13 PDT 2011


Thanks Jim,

That is what  found out. The only way seem to be to iterate through
the LLVM-basic block and trying to match LLVM-instructions to the
MachineInstr.
Though the matching logic has to written separately for each group of
instructions ( e.g. binary, call ..etc.)

Thanks and regards,
Ankur


On Fri, Jul 1, 2011 at 9:23 PM, Jim Grosbach <grosbach at apple.com> wrote:
> Hi Ankur,
>
> For a MachineBasicBlock you can call getBasicBlock() to find the IR level BasicBlock from which it was generated (if there isn't a one, it will return NULL). I don't know of a way to get a finer granularity than that, though.
>
> -Jim
>
> On Jul 1, 2011, at 1:06 AM, ankur deshwal wrote:
>
>> Hi,
>>
>> Is there any way to get a pointer to the LLVM Instr from which a
>> particular MachineInstr is generated ?
>>
>> Although I understand it goes through many optimization after a LLVM
>> instruction is converted to SDAG node, so maintaining such a mapping
>> will be hard. Still is the mapping stored some where which can give
>> some sane results at least in case of -O0?
>>
>> Thanks and regards,
>> Ankur
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list