[llvm-commits] [llvm] r126101 - /llvm/trunk/lib/Target/README.txt

Chris Lattner sabre at nondot.org
Sun Feb 20 17:33:38 PST 2011


Author: lattner
Date: Sun Feb 20 19:33:38 2011
New Revision: 126101

URL: http://llvm.org/viewvc/llvm-project?rev=126101&view=rev
Log:
add an idiom that loop idiom could theoretically catch.

Modified:
    llvm/trunk/lib/Target/README.txt

Modified: llvm/trunk/lib/Target/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/README.txt?rev=126101&r1=126100&r2=126101&view=diff
==============================================================================
--- llvm/trunk/lib/Target/README.txt (original)
+++ llvm/trunk/lib/Target/README.txt Sun Feb 20 19:33:38 2011
@@ -287,6 +287,16 @@
   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.
 
 //===---------------------------------------------------------------------===//





More information about the llvm-commits mailing list