Skip to content

Commit

Permalink
AllocOp: drop redundant verifier check
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ftynse authored and jpienaar committed Jul 4, 2019
1 parent a102b7d commit bf1d5b2
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions lib/StandardOps/Ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf1d5b2

Please sign in to comment.