Closed
Description
The upper bound check is wrong.
Simple example:
%reinterpret_cast = memref.reinterpret_cast %arg0 to offset: [0], sizes: [12, 64], strides: [64, 1] : memref<768xf32> to memref<12x64xf32>
Obvious, 768 = 12x64. But the result contains assert(false, ...)
.
I did some investigation. The generated upper bounds for base and result are 668 and 732 . The indices used to compute the upper bound are [768] and [12, 64]. I think that the indices of last element should be [767] and [11, 63]. In general, the index of a dimension starts from 0 and ends at size-1.