[LLVMdev] reg_iterator Caveats

Chris Lattner sabre at nondot.org
Mon Mar 31 16:55:31 PDT 2008


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.

> MachineRegisterInfo tracks virtual register only.

It works for vregs and pregs today.

> I also wish it would track physical register defs and uses as well. It
> can be used to simplify a lot of code (in livevariable, etc.). Chris,
> do you think that's feasible?

Really really feasible :)

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list