[llvm-commits] Fix for MachineSink creating zombie defines

Jan Sjodin jan_sjodin at yahoo.com
Fri Jul 29 12:13:03 PDT 2011



> -  return FromBB->SplitCriticalEdge(ToBB, this);
> +  MachineBasicBlock *result = FromBB->SplitCriticalEdge(ToBB, this);
> +
> +  // The live-ins from the successor must be copied to the new BB
> +  // or later sinks may create "zombie" defines.
> +  if (!ToBB->livein_empty())
> +    for (MachineBasicBlock::livein_iterator I = ToBB->livein_begin(),
> +       E = ToBB->livein_end(); I != E; ++I)
> +      result->addLiveIn(*I);
> +
> +  return result;
> }
> 
> static bool AvoidsSinking(MachineInstr *MI, MachineRegisterInfo *MRI) {
> 
> Is there some reason you're putting this into MachineSink.cpp instead
> of changing MachineBasicBlock::SplitCriticalEdge?

I was unsure if this is desirable for the generic function. Is that the better place for this?

> Missing a null check for result.
> 

Will fix with the next iteration.

- Jan





More information about the llvm-commits mailing list