Classifying Operands & Def/Use Chains

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Classifying Operands & Def/Use Chains

dag-7
Is there any way to discover whether a particular operand of a MachineInst
participates in addressing?  That is, if the MachineInst references memory,
can I tell, given an operand, whether that operand is part of the address
calculation for the instruction?

Also, is there any reasonable way to get the set of machine instructions to
which the output(s) of some machine instruction flows?  The closest I can find
is LiveVariables::VarInfo, but that only directly captures the kill points.  I
would have to iterate over instructions in the rest of the live range and see
if the output of  the defining instruction is used.

Thanks!

                                         -Dave
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Classifying Operands & Def/Use Chains

Chris Lattner

On Jan 11, 2008, at 2:00 PM, David Greene wrote:

> Is there any way to discover whether a particular operand of a  
> MachineInst
> participates in addressing?  That is, if the MachineInst references  
> memory,
> can I tell, given an operand, whether that operand is part of the  
> address
> calculation for the instruction?

Nope, not that I know of.

> Also, is there any reasonable way to get the set of machine  
> instructions to
> which the output(s) of some machine instruction flows?  The closest  
> I can find
> is LiveVariables::VarInfo, but that only directly captures the kill  
> points.  I
> would have to iterate over instructions in the rest of the live  
> range and see
> if the output of  the defining instruction is used.

On mainline, you can use the MachineRegisterInfo class (not  
MRegisterInfo) to walk all uses and defs (or just one class of them)  
of any register.  Use def_iterator (defs) use_iterator (uses) or  
reg_iterator (both) to get all uses/defs of a particular register,  
physical or virtual.

-Chris
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Classifying Operands & Def/Use Chains

dag-7
On Friday 11 January 2008 16:36, Chris Lattner wrote:

> On Jan 11, 2008, at 2:00 PM, David Greene wrote:
> > Is there any way to discover whether a particular operand of a
> > MachineInst
> > participates in addressing?  That is, if the MachineInst references
> > memory,
> > can I tell, given an operand, whether that operand is part of the
> > address
> > calculation for the instruction?
>
> Nope, not that I know of.

Ok.

> On mainline, you can use the MachineRegisterInfo class (not
> MRegisterInfo) to walk all uses and defs (or just one class of them)
> of any register.  Use def_iterator (defs) use_iterator (uses) or
> reg_iterator (both) to get all uses/defs of a particular register,
> physical or virtual.

Exactly what I need.  Thanks!  This must have gone in fairly recently.

                                       -Dave
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Classifying Operands & Def/Use Chains

Chris Lattner

On Jan 11, 2008, at 2:58 PM, David Greene wrote:

>> On mainline, you can use the MachineRegisterInfo class (not
>> MRegisterInfo) to walk all uses and defs (or just one class of them)
>> of any register.  Use def_iterator (defs) use_iterator (uses) or
>> reg_iterator (both) to get all uses/defs of a particular register,
>> physical or virtual.
>
> Exactly what I need.  Thanks!  This must have gone in fairly recently.

Yep, a couple weeks ago.

-Chris
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev