Skip to content

Commit 3c31ee7

Browse files
committed
[APInt] Call countTrailingZerosSlowCase() directly from isShiftedMask. NFC
We checked the single word case already and we already call countLeadingZerosSlowCase and countPopulationSlowCase.
1 parent c2a3ed2 commit 3c31ee7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/ADT/APInt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ class [[nodiscard]] APInt {
512512
return isShiftedMask_64(U.VAL);
513513
unsigned Ones = countPopulationSlowCase();
514514
unsigned LeadZ = countLeadingZerosSlowCase();
515-
return (Ones + LeadZ + countr_zero()) == BitWidth;
515+
return (Ones + LeadZ + countTrailingZerosSlowCase()) == BitWidth;
516516
}
517517

518518
/// Return true if this APInt value contains a non-empty sequence of ones with

0 commit comments

Comments
 (0)