Make promote single iteration optional on affine-loop-normalize:
introduce a command-line flag and an argument on the utility. Disable it
by default since such a promotion isn't normally expected with loop
normalization: it could drop certain structure or information on the
loops that a user wanted to preserve.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
We initially added this to --affine-loop-normalize. Probably it's not the best place but removing loops as part of canonicalization or a common simplification pass that is run all over the pipeline can be problematic as it drops information about the input dimensions. This may prevent or make some transformations harder. I'd suggest that we use the loop specific normalization pass or create a new pass to simplify loops and other control-flow structures. What do you think?
Another alternative/solution is to perform this promotion under a pass option? Can be enabled or disabled and perhaps disabled by default?
Thanks. I just noticed that it's already part of affine-loop-normalize - had forgotten about it. Perhaps we should either remove or disable it by default from there as well for the reasons you mention.
556 LogicalResult mlir::normalizeAffineFor(AffineForOp op) { 557 if (succeeded(promoteIfSingleIteration(op))) 558 return success();
Yeah, sorry, my comment sounded as if we had removed it from affine-loop-normalize and that's not the case :). A flag or a new pass sound good to me.