From a92248600ec4acba00db566a54c8ce53de807e3c Mon Sep 17 00:00:00 2001 From: Nicolas Vasilache Date: Sun, 10 Jan 2021 14:01:54 +0000 Subject: [PATCH] [mlir] NFC - Drop spurious assertion on symbols during `promoteComposedSymbolsAsDims` This assertion is an old remnant from earlier days when only affine functions existed. It is not the place of affine map composition to check whether orthogonal considerations on what is allowed to be a symbol under the AffineScope trait. --- mlir/lib/Dialect/Affine/IR/AffineOps.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp index 3fd1b62..2e75cd0 100644 --- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp +++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp @@ -635,12 +635,6 @@ static AffineMap promoteComposedSymbolsAsDims(AffineMap map, return map; } - // Sanity check on symbols. - for (auto sym : symbols) { - assert(isValidSymbol(sym) && "Expected only valid symbols"); - (void)sym; - } - // Extract the symbol positions that come from an AffineApplyOp and // needs to be rewritten as dims. auto symPositions = indicesFromAffineApplyOp(symbols); @@ -2401,8 +2395,7 @@ LogicalResult AffineStoreOp::fold(ArrayRef cstOperands, // AffineMinMaxOpBase //===----------------------------------------------------------------------===// -template -static LogicalResult verifyAffineMinMaxOp(T op) { +template static LogicalResult verifyAffineMinMaxOp(T op) { // Verify that operand count matches affine map dimension and symbol count. if (op.getNumOperands() != op.map().getNumDims() + op.map().getNumSymbols()) return op.emitOpError( @@ -2410,8 +2403,7 @@ static LogicalResult verifyAffineMinMaxOp(T op) { return success(); } -template -static void printAffineMinMaxOp(OpAsmPrinter &p, T op) { +template static void printAffineMinMaxOp(OpAsmPrinter &p, T op) { p << op.getOperationName() << ' ' << op->getAttr(T::getMapAttrName()); auto operands = op.getOperands(); unsigned numDims = op.map().getNumDims(); -- 2.7.4