[llvm-commits] [llvm] r95739 - in /llvm/trunk/lib/CodeGen: LiveIntervalAnalysis.cpp SimpleRegisterCoalescing.cpp

Chris Lattner clattner at apple.com
Tue Feb 9 17:11:23 PST 2010


On Feb 9, 2010, at 4:55 PM, Dale Johannesen wrote:
> URL: http://llvm.org/viewvc/llvm-project?rev=95739&view=rev
> Log:
> Skip DBG_VALUE many places in live intervals and
> register coalescing.  This fixes many crashes and
> places where debug info affects codegen (when
> dbg.value is lowered to machine instructions, which
> it isn't yet in TOT).

Ok.

> +  MachineBasicBlock::iterator E = MBB->end();
> +  while (mi != E) {
> +    if (!mi->isDebugValue()) {

Can't this use continue like this:

if (!mi->isDebugValue()) {
   ++mi;
   continue;
}

?

-Chris


> +      if (mi->killsRegister(interval.reg, tri_)) {
> +        DEBUG(dbgs() << " killed");
> +        end = baseIndex.getDefIndex();
> +        SeenDefUse = true;
> +        break;
> +      } else if (mi->modifiesRegister(interval.reg, tri_)) {
> +        // Another instruction redefines the register before it is  
> ever read.
> +        // Then the register is essentially dead at the instruction  
> that defines
> +        // it. Hence its interval is:
> +        // [defSlot(def), defSlot(def)+1)
> +        DEBUG(dbgs() << " dead");
> +        end = start.getStoreIndex();
> +        SeenDefUse = true;
> +        break;
> +      }
> +    }
>




More information about the llvm-commits mailing list