add an idiom that loop idiom could theoretically catch.

llvm-svn: 126101
This commit is contained in:
Chris Lattner 2011-02-21 01:33:38 +00:00
parent 39314bdbc8
commit 659c793a4e
1 changed files with 10 additions and 0 deletions

View File

@ -287,6 +287,16 @@ unsigned int popcount(unsigned int input) {
return count;
}
This should be recognized as CLZ: rdar://8459039
unsigned clz_a(unsigned a) {
int i;
for (i=0;i<32;i++)
if (a & (1<<(31-i)))
return i;
return 32;
}
This sort of thing should be added to the loop idiom pass.
//===---------------------------------------------------------------------===//