llvm.org GIT mirror llvm / 452b93e
Use getAllOnesValue, saves a copy and looks better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110991 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 9 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
463463 // For small values, return quickly
464464 if (numBits <= APINT_BITS_PER_WORD)
465465 return APInt(numBits, ~0ULL << shiftAmt);
466 return (~APInt(numBits, 0)).shl(shiftAmt);
466 return getAllOnesValue(numBits).shl(shiftAmt);
467467 }
468468
469469 /// Constructs an APInt value that has the bottom loBitsSet bits set.
480480 // For small values, return quickly.
481481 if (numBits < APINT_BITS_PER_WORD)
482482 return APInt(numBits, (1ULL << loBitsSet) - 1);
483 return (~APInt(numBits, 0)).lshr(numBits - loBitsSet);
483 return getAllOnesValue(numBits).lshr(numBits - loBitsSet);
484484 }
485485
486486 /// The hash value is computed as the sum of the words and the bit width.