add a missed loop deletion case.

llvm-svn: 126103
This commit is contained in:
Chris Lattner 2011-02-21 02:13:39 +00:00
parent 9d2899115f
commit c373140c8b

View File

@ -254,6 +254,20 @@ unsigned long reverse(unsigned v) {
//===---------------------------------------------------------------------===//
[LOOP DELETION]
We don't delete this output free loop, because trip count analysis doesn't
realize that it is finite (if it were infinite, it would be undefined). Not
having this blocks Loop Idiom from matching strlen and friends.
void foo(char *C) {
int x = 0;
while (*C)
++x,++C;
}
//===---------------------------------------------------------------------===//
[LOOP RECOGNITION]
These idioms should be recognized as popcount (see PR1488):