[mlir] NFC - Drop spurious assertion on symbols during `promoteComposedSymbolsAsDims`
authorNicolas Vasilache <nicolas.vasilache@gmail.com>
Sun, 10 Jan 2021 14:01:54 +0000 (14:01 +0000)
committerNicolas Vasilache <nicolas.vasilache@gmail.com>
Sun, 10 Jan 2021 14:02:16 +0000 (14:02 +0000)
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

index 3fd1b62..2e75cd0 100644 (file)
@@ -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<Attribute> cstOperands,
 // AffineMinMaxOpBase
 //===----------------------------------------------------------------------===//
 
-template <typename T>
-static LogicalResult verifyAffineMinMaxOp(T op) {
+template <typename T> 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 <typename T>
-static void printAffineMinMaxOp(OpAsmPrinter &p, T op) {
+template <typename T> static void printAffineMinMaxOp(OpAsmPrinter &p, T op) {
   p << op.getOperationName() << ' ' << op->getAttr(T::getMapAttrName());
   auto operands = op.getOperands();
   unsigned numDims = op.map().getNumDims();