[LLVMdev] Bug in MachineRegisterInfo ?

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Apr 10 10:57:15 PDT 2012


On Apr 10, 2012, at 10:20 AM, Pranav Bhandarkar wrote:

> Hi,
> 
> I wanted to see the non-debug uses of register 0 (Noreg) and so, I wrote the
> following piece of code.
> 
> *****
> MRI = &MF.getRegInfo();
> if (!MRI->use_nodbg_empty(0)) {
> 
>    for (MachineRegisterInfo::use_nodbg_iterator
> 
>           ri = MRI->use_nodbg_begin(0), re = MRI->use_nodbg_end();
> 
>         ri != re; ++ri) {
> 
>      MachineInstr *UseMI = &*ri;
> 
>      UseMI->dump ();
> 
>    }
> 
>  }
> *****
> 
> But I see that UseMI is
> DBG_VALUE %noreg, 0, !"foobar"; line no:511 inlined @[ foo.cc:364:5 ]
> 
> Also, when I want to check what "isDebugValue" returns, I get this.
> (gdb) p UseMI->isDebugValue()
> 
> $1 = true
> 
> Isn't this a bug ? There seems to be something wrong or am I missing
> something ?

It looks like the MachineOperand IsDebug flag hasn't been set.

/jakob




More information about the llvm-dev mailing list