EDSC: support 'for' loops with dynamic bounds
The existing implementation in EDSC of 'for' loops in MLIREmitter is unnecessarily restricted to constant bounds. The underlying AffineForOp can be constructed from (a list of) Values and AffineMaps instead of constants. Its verifier will check that the "affine provenance" conditions, i.e. that the values used in the loop conditions are defined in such a way that they can be analyzed by affine passes, are respected. One can use non-constant values in affine loop bounds in conjunction with a single-dimensional identity affine map. Implement this in MLIREmitter while maintaining the special case for constant bounds that leads to significantly simpler generated IR when applicable. Test this change using the EDSC lowering test pass to inject code emitted from EDSC into functions with predefined names. PiperOrigin-RevId: 233578220
Loading
Please sign in to comment