[Mlir-commits] [mlir] a922486 - [mlir] NFC - Drop spurious assertion on symbols during `promoteComposedSymbolsAsDims`

Nicolas Vasilache llvmlistbot at llvm.org
Sun Jan 10 06:07:13 PST 2021


Author: Nicolas Vasilache
Date: 2021-01-10T14:02:16Z
New Revision: a92248600ec4acba00db566a54c8ce53de807e3c

URL: https://github.com/llvm/llvm-project/commit/a92248600ec4acba00db566a54c8ce53de807e3c
DIFF: https://github.com/llvm/llvm-project/commit/a92248600ec4acba00db566a54c8ce53de807e3c.diff

LOG: [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.

Added: 
    

Modified: 
    mlir/lib/Dialect/Affine/IR/AffineOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp
index 3fd1b62a5d2d..2e75cd07ed83 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<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();


        


More information about the Mlir-commits mailing list