MLIR 23.0.0git
MemorySlotUtils.h
Go to the documentation of this file.
1//===- MemorySlotUtils.h - Utilities for MemorySlot interfaces --*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares common utilities for implementing MemorySlot interfaces,
10// in particular PromotableRegionOpInterface.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MLIR_INTERFACES_UTILS_MEMORYSLOTUTILS_H
15#define MLIR_INTERFACES_UTILS_MEMORYSLOTUTILS_H
16
18
19namespace mlir {
20namespace memoryslot {
21
22/// Appends the reaching definition for the given block as an operand to its
23/// terminator. If the block has no entry in `reachingAtBlockEnd` (e.g. dead
24/// code or the region does not use the slot), `defaultReachingDef` is used.
25void updateTerminator(Block *block, Value defaultReachingDef,
26 const DenseMap<Block *, Value> &reachingAtBlockEnd);
27
28/// Creates a shallow copy of an operation with new result types, moving the
29/// regions out of the original operation and deleting the original operation.
31 TypeRange resultTypes);
32
33} // namespace memoryslot
34} // namespace mlir
35
36#endif // MLIR_INTERFACES_UTILS_MEMORYSLOTUTILS_H
Block represents an ordered list of Operations.
Definition Block.h:33
Operation is the basic unit of execution within MLIR.
Definition Operation.h:88
This class coordinates the application of a rewrite on a set of IR, providing a way for clients to tr...
This class provides an abstraction over the various different ranges of value types.
Definition TypeRange.h:40
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
Operation * replaceWithNewResults(RewriterBase &rewriter, Operation *op, TypeRange resultTypes)
Creates a shallow copy of an operation with new result types, moving the regions out of the original ...
void updateTerminator(Block *block, Value defaultReachingDef, const DenseMap< Block *, Value > &reachingAtBlockEnd)
Appends the reaching definition for the given block as an operand to its terminator.
Include the generated interface declarations.
llvm::DenseMap< KeyT, ValueT, KeyInfoT, BucketT > DenseMap
Definition LLVM.h:120