[llvm-commits] [llvm] r168829 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Bill Wendling isanbard at gmail.com
Wed Dec 5 16:34:50 PST 2012


On Dec 5, 2012, at 4:31 PM, Nick Lewycky <nlewycky at google.com> wrote:

> > +
> > +      for (SmallVectorImpl<BasicBlock*>::iterator
> > +             II = Successors.begin(), IE = Successors.end(); II != IE; ++II)
> > +        if (pred_begin(*II) == pred_end(*II))
> >
> > What if the block includes a branch to itself?
> >
> Won't the predecessor list be non-empty then?
> 
> Right, and the block is dead and we want to delete it, but won't. This isn't a bug, just a missed optz'n.
> 
In that case, the CodeGen pass won't even look at the block. In truth, this whole deleting of dead blocks is superfluous. It's questionable if it should be done at all here...

-bw





More information about the llvm-commits mailing list