From 17a29a48474b5848b6e306bebc8068e3268fdfa2 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 25 Mar 2015 15:36:57 +0000 Subject: [PATCH] [Hexagon] Pattern match a CTZ loop into a call to countTrailingZeros. 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 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp b/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp index 5bb4c095cf0..aaccac8b57a 100644 --- a/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp +++ b/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp @@ -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; -- 2.11.0