Existing implementation of structured op splitting creates several
affine.apply and affine.min operations in its subshape computation.
As these shapes are further used in data slice extraction, this may lead
to slice shapes being dynamic even when the original shapes and the
splitting point are static. This is particularly visible when splitting
is combined with further subsetting transformations such as tiling. Use
composition and folding more aggressively in splitting to avoid this.
In particular, introduce a createComposedAffineMin function that the
affine map used in "min" with the maps used by any affine.apply that
may be feeding the operands to the "min". This enables production of
more static shapes. Also introduce a createComposedFoldedAffineApply
function that combines the existing createComposedAffineApply with
in-place folding to propagate constants produced by zero-input affine
maps. Using these when splitting allows the subsequent canonicalizer
pass to recover static shapes for structured ops.
Is there no need for a folded version like in the above ?