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;