[Mlir-commits] [mlir] [mlir][affine] Implement PromotableRegionOpInterface for AffineForOp (PR #221123)
Tobias Gysi
llvmlistbot at llvm.org
Thu Sep 3 23:38:45 PDT 2026
================
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+// 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/Affine/IR/AffineOps.h"
+#include "mlir/Interfaces/Utils/MemorySlotUtils.h"
+
+using namespace mlir;
+using namespace mlir::affine;
+
+//===----------------------------------------------------------------------===//
+// AffineForOp
+//===----------------------------------------------------------------------===//
+
+bool AffineForOp::isRegionPromotable(const MemorySlot &slot, Region *region,
+ bool hasValueStores) {
+ return true;
+}
+
+void AffineForOp::setupPromotion(
+ const MemorySlot &slot, Value reachingDef, bool hasValueStores,
+ llvm::SmallMapVector<Region *, Value, 2> ®ionsToProcess) {
+
----------------
gysit wrote:
```suggestion
```
ultra nit: can you drop the redundant newline here?
https://github.com/llvm/llvm-project/pull/221123
More information about the Mlir-commits
mailing list