[mlir] Add multi-level AffineMinSCF floding support
This revision allows chains of AffineMinOp that depend on SCF induction variables to fold. This allows the foldings of IR such as:
#map1 = affine_map<(d0) -> (128, -d0 + 192)> #map2 = affine_map<(d0, d1) -> (16, d0 - d1)> scf.parallel (%i) = (%c0) to (%c192) step (%c128) { %1 = affine.min #map1(%i) scf.for %j = %c0 to %1 step %c16 { %2 = affine.min #map2(%1, %j) %3 = index_cast %2: index to i64 store %3, %A[]: memref<i64>
into:
#map1 = affine_map<(d0) -> (128, -d0 + 192)> scf.parallel (%arg1) = (%c0) to (%c192) step (%c128) { %0 = affine.min #map1(%arg1) scf.for %arg2 = %c0 to %0 step %c16 { store %c16_i64, %arg0[] : memref<i64>
Note that handling chains is required because 192 % 128 != 0 but 192 % 16 == 0.
outerloops -> outer loops
Again, canonicalize -> fold?