The following:
mlir-opt -lower-affine -debug mlir/test/Conversion/AffineToStandard/lower-affine-to-vector.mlir
triggers an assertion:
affine.for mlir-opt: mlir/include/mlir/IR/OpDefinition.h:839: mlir::Block *mlir::OpTrait::SingleBlock<mlir::AffineForOp>::getBody(unsigned int) [ConcreteType = mlir::AffineFo rOp]: Assertion `!region.empty() && "unexpected empty region"' failed.
Since the IR is in an invalid state after AffineForOp is lowered to
scf::ForOp in AffineForLowering.
Bail out in AffineForOp::print if the region is empty.