[LLVMdev] reg_iterator Caveats

Chris Lattner sabre at nondot.org
Sun Mar 30 11:30:40 PDT 2008


On Mar 30, 2008, at 11:17 AM, David Greene wrote:
> I'm forwarding this to llvmdev so it doesn't get lost in the sea of  
> commits...

reg_iterators are independent of SSA or not.  The basic issue is that  
if you loop over uses or defs of a register, it will return *all* the  
uses/defs of that register in the current function.  If the value is  
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.

That said, ref_iterator and variants will always do what they are  
documented to, they just don't magically provide ssa-like properties  
for physregs.

-Chris




More information about the llvm-dev mailing list