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
unsafe.

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.

Nick

_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to