[Mlir-commits] [mlir] [mlir] [memref] add more checks to the memref.reinterpret_cast (PR #112669)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Oct 25 08:30:28 PDT 2024


================
@@ -1892,11 +1892,12 @@ LogicalResult ReinterpretCastOp::verify() {
   // Match sizes in result memref type and in static_sizes attribute.
   for (auto [idx, resultSize, expectedSize] :
        llvm::enumerate(resultType.getShape(), getStaticSizes())) {
-    if (!ShapedType::isDynamic(resultSize) &&
-        !ShapedType::isDynamic(expectedSize) && resultSize != expectedSize)
+    if (!ShapedType::isDynamic(resultSize) && resultSize != expectedSize)
       return emitError("expected result type with size = ")
-             << expectedSize << " instead of " << resultSize
-             << " in dim = " << idx;
+             << (ShapedType::isDynamic(expectedSize)
----------------
MaheshRavishankar wrote:

If I am reading the logic correctly, this check is not needed (here and everywhere below.)

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


More information about the Mlir-commits mailing list