mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-10 06:25:01 +00:00
add an idiom that loop idiom could theoretically catch.
llvm-svn: 126101
This commit is contained in:
parent
3384d8f317
commit
8760c28fe1
@ -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.
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
Loading…
x
Reference in New Issue
Block a user