[llvm-commits] ScalarEvolution fix for treeadd

Nick Lewycky nicholas at mxc.ca
Mon Jul 23 08:42:22 PDT 2007

On Mon, 2007-07-23 at 09:58 -0500, Dan Gohman wrote:
> > +    // If we can show that there is no inner cycle in the loop then we know
> > +    // that the execution count must equal the branch count.
> Would it be too intrusive to ask ScalarEvolution to use a
> PostDominanceFrontier for this?

No, that's what I implemented at first. Unfortunately, it doesn't cover
all the possible cases (specifically, it broke 2007-01-06-TripCount.ll).

In 2007-01-06-TripCount.ll there's two "loops" sharing one loop header.
The first runs from header -> exit -> A -> header and the other is
header -> B -> A -> header. I was testing exit postdom header, which it
does, but that didn't catch this case where the transform is still

If you think I merely had my test wrong, please let me know what you
think it ought to be and I'll implement it and see.


More information about the llvm-commits mailing list