[Mlir-commits] [mlir] [MLIR][Mem2Reg] Extract shared utilities for PromotableRegionOpInterface (PR #188514)
Tobias Gysi
llvmlistbot at llvm.org
Thu Mar 26 01:59:59 PDT 2026
================
@@ -0,0 +1,36 @@
+//===- MemorySlotUtils.h - Utilities for MemorySlot interfaces --*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares common utilities for implementing MemorySlot interfaces,
+// in particular PromotableRegionOpInterface.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef MLIR_INTERFACES_UTILS_MEMORYSLOTUTILS_H
+#define MLIR_INTERFACES_UTILS_MEMORYSLOTUTILS_H
+
+#include "mlir/IR/PatternMatch.h"
+
+namespace mlir {
+namespace memoryslot {
+
+/// Appends the reaching definition for the given block as an operand to its
+/// terminator. If the block has no entry in \p reachingAtBlockEnd (e.g. dead
+/// code or the region does not use the slot), \p defaultReachingDef is used.
----------------
gysit wrote:
```suggestion
/// terminator. If the block has no entry in `reachingAtBlockEnd` (e.g. dead
/// code or the region does not use the slot), `defaultReachingDef` is used.
```
ultra nit: we use back ticks when referencing function arguments.
https://github.com/llvm/llvm-project/pull/188514
More information about the Mlir-commits
mailing list