From bd17bd299ffdfc32593bcd8abe31f0f40cd695fa Mon Sep 17 00:00:00 2001 From: Alex Zinenko Date: Thu, 4 Jul 2019 07:47:34 -0700 Subject: [PATCH] AllocOp: drop redundant verifier check The equality check between the rank of a memref and the input size of the layout affine map in AllocOp::verify is subsumed by the well-formedness check of the memref type itself. Drop the redundant check from the verifier since it is never exercised (the type builder does not allow one to construct a type that would not pass the verifier check). PiperOrigin-RevId: 256551247 --- mlir/lib/StandardOps/Ops.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/mlir/lib/StandardOps/Ops.cpp b/mlir/lib/StandardOps/Ops.cpp index 052300f53f54..cb2253ff2cec 100644 --- a/mlir/lib/StandardOps/Ops.cpp +++ b/mlir/lib/StandardOps/Ops.cpp @@ -264,15 +264,6 @@ static LogicalResult verify(AllocOp op) { AffineMap affineMap = memRefType.getAffineMaps()[0]; // Store number of symbols used in affine map (used in subsequent check). numSymbols = affineMap.getNumSymbols(); - // TODO(zinenko): this check does not belong to AllocOp, or any other op but - // to the type system itself. It has been partially hoisted to Parser but - // remains here in case an AllocOp gets constructed programmatically. - // Remove when we can emit errors directly from *Type::get(...) functions. - // - // Verify that the layout affine map matches the rank of the memref. - if (affineMap.getNumDims() != memRefType.getRank()) - return op.emitOpError( - "affine map dimension count must equal memref rank"); } unsigned numDynamicDims = memRefType.getNumDynamicDims(); // Check that the total number of operands matches the number of symbols in