[Mlir-commits] [mlir] [mlir][Linalg] Refine how broadcast dims are treated (PR #99015)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Jul 22 00:35:03 PDT 2024


================
@@ -540,6 +540,18 @@ AffineMap AffineMap::dropResults(const llvm::SmallBitVector &positions) const {
   return AffineMap::get(getNumDims(), getNumSymbols(), exprs, getContext());
 }
 
+AffineMap AffineMap::dropZeros() {
+  auto exprs = llvm::to_vector<4>(getResults());
+  SmallVector<AffineExpr, 8> newExprs;
+
+  for (auto expr : getResults()) {
+    auto constExpr = dyn_cast<AffineConstantExpr>(expr);
+    if (!constExpr)
----------------
banach-space wrote:

Fixed, thanks!

https://github.com/llvm/llvm-project/pull/99015


More information about the Mlir-commits mailing list