[Mlir-commits] [mlir] [MLIR] Fix mlir-opt crash in ReshapeOpsUtils.cpp when collapse_shape index is invalid (PR #173791)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Dec 29 01:25:52 PST 2025


================
@@ -2072,6 +2072,11 @@ LogicalResult ExpandShapeOp::verify() {
 }
 
 LogicalResult CollapseShapeOp::verify() {
+  CollapseShapeOp op = *this;
+  if (llvm::any_of(op.getReassociationIndices(),
+                   [](auto &group) { return group.empty(); })) {
----------------
ftynse wrote:

Nit: please expand `auto` unless the type is obvious from the statement-level context or unavoidable. Here I suspect it should be something like `ValueRange`, at which point you don't need a reference.

https://github.com/llvm/llvm-project/pull/173791


More information about the Mlir-commits mailing list