[LLVMdev] slotindex:getIndex

Lang Hames lhames at gmail.com
Fri May 3 11:07:34 PDT 2013

Hi Shrey,

Could you clarify what you're trying to do?

If there is a single defining instruction for a LiveRange you can get its
SlotIndex from the VNInfo structure attached to the live range.
If you want to search through definitions of a virtual register you can do
that with the def_iterators in MachineRegisterInfo.

Some things to keep in mind: SlotIndexes do not track source lines, they
only provide a full ordering of MachineInstrs for the purpose of register
allocation and related passes. There is no public access to the number
underlying a SlotIndex. This is by design, as they are intended to provide
ordering only.


On Fri, May 3, 2013 at 9:53 AM, shreyas krishnan <shreyas76 at gmail.com>wrote:

> HI
>   Is there a public function equivalent of calling getIndex I would
> like to use some sort of starting slot info of a live interval in some
> pass. I need a way of comparing which virtual register is associated
> with an earlier source line without relying on any debug info. The
> relative order is preserved in my case.
> thanks
> shrey
> _______________________________________________
> 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/20130503/2e7b0150/attachment.html>

More information about the llvm-dev mailing list