OSDN Git Service

[Hexagon] Pattern match a CTZ loop into a call to countTrailingZeros.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 25 Mar 2015 15:36:57 +0000 (15:36 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 25 Mar 2015 15:36:57 +0000 (15:36 +0000)
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233192 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Hexagon/HexagonISelDAGToDAG.cpp

index 5bb4c09..aaccac8 100644 (file)
@@ -1137,10 +1137,7 @@ SDNode *HexagonDAGToDAGISel::SelectBitOp(SDNode *N) {
       return SelectCode(N);
 
     // Get the bit position.
-    while (!(Val & 1)) {
-      Val >>= 1;
-      ++bitpos;
-    }
+    bitpos = countTrailingZeros(uint64_t(Val));
   } else {
     // For fabs and fneg, it's always the 31st bit.
     bitpos = 31;