[LLVMdev] reg_iterator Caveats

Evan Cheng evan.cheng at apple.com
Tue Apr 1 10:00:06 PDT 2008


On Apr 1, 2008, at 8:47 AM, David Greene wrote:

> On Monday 31 March 2008 18:55, Chris Lattner wrote:
>> On Mon, 31 Mar 2008, Evan Cheng wrote:
>>>> I just discovered that def_itterator (and presumably, reg_iterator)
>>>> doesn't
>>>> include implicit defs, for example at function calls for caller- 
>>>> save
>>>> physical
>>>> registers.  Guh.  I'm not sure if it should or not, but it's  
>>>> certainly
>>>> necessary information in some cases.  Is this expected behavior,  
>>>> or an
>>>> oversight?
>>
>> reg iterators will return everything that is in the function.  If the
>> implicit operands haven't been added to the machieninstrs yet, then  
>> they
>> won't be returned.
>
> Hmm...this is definitely NOT true in my copy.  During register  
> allocation
> these implicit defs are not returned.  By then the instructions are  
> most
> definitely fully constructed.  :)
>
> We have a very old copy of llvm.  Is it possible they got added  
> sometime
> after reg_iterators were created?

Not sure.

>
>
> Also, just as a point of information, where would I go to find out  
> if a
> physical register is a caller-save or callee-save register?  The  
> closest
> thing I can find is in the .td files but no interface is generated  
> (as far
> as I can tell) to categorize physical registers according to calling
> convention.

See X86RegisterInfo::getCalleeSavedRegs() etc.

Evan
>
>
>                                               -Dave
> _______________________________________________
> 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