Large integers are generated in Circt commonly which exceed 4kbits. This aligns the maximum bitwidth in MLIR and LLVM.
Reviewed By: rriddle, lattner, mehdi_amini
Differential Revision: https://reviews.llvm.org/D94116
IntegerType scaleElementBitwidth(unsigned scale);
/// Integer representation maximal bitwidth.
- static constexpr unsigned kMaxWidth = 4096;
+ static constexpr unsigned kMaxWidth = (1 << 24) - 1; // Aligned with LLVM
};
//===----------------------------------------------------------------------===//
func @intlimit2() {
^bb:
- %0 = "std.constant"() {value = 0} : () -> i4096
- %1 = "std.constant"() {value = 1} : () -> i4097 // expected-error {{integer bitwidth is limited to 4096 bits}}
+ %0 = "std.constant"() {value = 0} : () -> i16777215
+ %1 = "std.constant"() {value = 1} : () -> i16777216 // expected-error {{integer bitwidth is limited to 16777215 bits}}
return
}