[Mlir-commits] [mlir] Validate type consistency in reintepret cast sizes (PR #140032)
Matthias Springer
llvmlistbot at llvm.org
Thu May 15 15:38:06 PDT 2025
================
@@ -1835,6 +1835,15 @@ LogicalResult ReinterpretCastOp::verify() {
// Match sizes in result memref type and in static_sizes attribute.
for (auto [idx, resultSize, expectedSize] :
llvm::enumerate(resultType.getShape(), getStaticSizes())) {
+ // Check that dynamic sizes are not mixed with static sizes
+ if (ShapedType::isDynamic(resultSize) &&
+ !ShapedType::isDynamic(expectedSize))
+ return emitError(
+ "expectedSize is static but received a dynamic resultSize ");
+ if (!ShapedType::isDynamic(resultSize) &&
+ ShapedType::isDynamic(expectedSize))
+ return emitError(
+ "expectedSize is dynamic but received a static resultSize ");
----------------
matthias-springer wrote:
same
https://github.com/llvm/llvm-project/pull/140032
More information about the Mlir-commits
mailing list