On Monday 31 March 2008 00:57, Chris Lattner wrote:> On Mar 30, 2008, at 10:42 PM, David A. Greene wrote: > >> SSA form, it is reasonable to say "give me the first def" and expect > >> it to be the only def. For multiply defined values like physregs, > >> this is not true, because the reg can have multiple defs. > > > > Gotcha. This is exactly what I want. Thanks for the explanation. > > > > For non-SSA values, is there some indication of which defs reach which > > uses? I don't need this right now but I can imagine using it in the > > future. > > The reg def/kill/dead flags are all that there is.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? -Dave
On Mar 31, 2008, at 2:53 PM, David Greene wrote:> On Monday 31 March 2008 00:57, Chris Lattner wrote: >> On Mar 30, 2008, at 10:42 PM, David A. Greene wrote: >>>> SSA form, it is reasonable to say "give me the first def" and >>>> expect >>>> it to be the only def. For multiply defined values like physregs, >>>> this is not true, because the reg can have multiple defs. >>> >>> Gotcha. This is exactly what I want. Thanks for the explanation. >>> >>> For non-SSA values, is there some indication of which defs reach >>> which >>> uses? I don't need this right now but I can imagine using it in the >>> future. >> >> The reg def/kill/dead flags are all that there is. > > 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?MachineRegisterInfo tracks virtual register only. 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? Evan> > > -Dave > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
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/