[Mlir-commits] [mlir] [mlir][tensor] Add ValueBoundsOpInterface for ExpandShapeOp and CollapseShapeOp (PR #173356)
Matthias Springer
llvmlistbot at llvm.org
Tue Dec 23 04:25:21 PST 2025
================
@@ -31,6 +31,27 @@ struct CastOpInterface
}
};
+struct CollapseShapeOpInterface
+ : public ValueBoundsOpInterface::ExternalModel<CollapseShapeOpInterface,
+ CollapseShapeOp> {
+ void populateBoundsForShapedValueDim(Operation *op, Value value, int64_t dim,
+ ValueBoundsConstraintSet &cstr) const {
+ auto collapseOp = cast<CollapseShapeOp>(op);
+ assert(value == collapseOp.getResult() && "invalid value");
+
+ // Multiply the expressions for the dimensions in the reassociation group.
+ const ReassociationIndices reassocIndices =
----------------
matthias-springer wrote:
nit: const reference
https://github.com/llvm/llvm-project/pull/173356
More information about the Mlir-commits
mailing list