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

Arjun Parmar llvmlistbot at llvm.org
Mon Dec 29 10:10:16 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(); })) {
----------------
akparmar004 wrote:

Thanks for the review! I expanded auto to ReassociationIndices since getReassociationIndices() returns that type. Let me know if you'd prefer a different approach.

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


More information about the Mlir-commits mailing list