diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h index 02d58d8c3d31c..aeb17a846f3c1 100644 --- a/llvm/include/llvm/ADT/APInt.h +++ b/llvm/include/llvm/ADT/APInt.h @@ -1366,11 +1366,10 @@ class [[nodiscard]] APInt { /// This function handles case when \p loBit <= \p hiBit. void setBits(unsigned loBit, unsigned hiBit) { assert(hiBit <= BitWidth && "hiBit out of range"); - assert(loBit <= BitWidth && "loBit out of range"); assert(loBit <= hiBit && "loBit greater than hiBit"); if (loBit == hiBit) return; - if (loBit < APINT_BITS_PER_WORD && hiBit <= APINT_BITS_PER_WORD) { + if (hiBit <= APINT_BITS_PER_WORD) { uint64_t mask = WORDTYPE_MAX >> (APINT_BITS_PER_WORD - (hiBit - loBit)); mask <<= loBit; if (isSingleWord())