[Mlir-commits] [mlir] [mlir][vector] Add mask elimination transform (PR #99314)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Jul 29 02:29:00 PDT 2024


================
@@ -0,0 +1,131 @@
+//===- VectorMaskElimination.cpp - Eliminate Vector Masks -----------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/Arith/IR/Arith.h"
+#include "mlir/Dialect/Utils/StaticValueUtils.h"
+#include "mlir/Dialect/Vector/IR/ScalableValueBoundsConstraintSet.h"
+#include "mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h"
+#include "mlir/Dialect/Vector/Transforms/VectorTransforms.h"
+#include "mlir/Interfaces/FunctionInterfaces.h"
+
+using namespace mlir;
+using namespace mlir::vector;
+namespace {
+
+/// If `value` is a constant multiple of `vector.vscale` return the multiplier.
----------------
banach-space wrote:

```suggestion
/// If `value` is a constant multiple of `vector.vscale` (e.g. `%cst * vector.vscale`), return the multiplier (`%cst`). Otherwise return `std::nullopt`.
```

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


More information about the Mlir-commits mailing list