The following IR:
%struct.large = type { [2500000 x i8] } define void @foo(%struct.large %s, %struct.large* %p) { store %struct.large %s, %struct.large* %p, align 1 ret void }
caused assertion 'NumBits <= MAX_INT_BITS && "bitwidth too large"' failure.
The IR above is a minimized version from IR from an actual bug report. Keeping
in mind that such IR is discouraged, the compiler should not fail on a formally
valid input. The patch fixes this issue.
Fixing that also requires widening NumValues and NumOperands fields of SDNode
to avoid fail of another assertion about insufficient bit width of those fields.
Reordering of SDNode fields was done to keep sizeof(SDNode) == 80 on x86_64
Linux builds.
Isn't this hard-coded to unsigned/uint32_t? What about exposing a typedef in SDNode instead so we can use std::numeric_limits? .