MLIR
22.0.0git
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
a
c
f
h
i
k
m
n
o
p
r
s
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
m
n
o
p
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
f
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
c
d
e
f
g
h
i
k
l
m
n
p
r
s
u
v
Related Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
g
h
i
m
n
o
r
s
t
u
v
y
Enumerations
Enumerator
a
b
c
e
f
g
i
m
n
s
t
w
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
y
z
lib
Dialect
ControlFlow
Transforms
BufferizableOpInterfaceImpl.cpp
Go to the documentation of this file.
1
//===- BufferizableOpInterfaceImpl.cpp - Impl. of BufferizableOpInterface -===//
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
#include "
mlir/Dialect/ControlFlow/Transforms/BufferizableOpInterfaceImpl.h
"
10
11
#include "
mlir/Dialect/Bufferization/IR/UnstructuredControlFlow.h
"
12
#include "
mlir/Dialect/ControlFlow/IR/ControlFlowOps.h
"
13
#include "
mlir/IR/Operation.h
"
14
15
using namespace
mlir
;
16
using namespace
mlir::bufferization
;
17
18
namespace
mlir
{
19
namespace
cf {
20
namespace
{
21
22
template
<
typename
ConcreteModel,
typename
ConcreteOp>
23
struct
BranchLikeOpInterface
24
:
public
BranchOpBufferizableOpInterfaceExternalModel
<ConcreteModel,
25
ConcreteOp> {
26
bool
bufferizesToMemoryRead(
Operation
*op,
OpOperand
&opOperand,
27
const
AnalysisState
&state)
const
{
28
return
false
;
29
}
30
31
bool
bufferizesToMemoryWrite(
Operation
*op,
OpOperand
&opOperand,
32
const
AnalysisState
&state)
const
{
33
return
false
;
34
}
35
36
LogicalResult verifyAnalysis(
Operation
*op,
37
const
AnalysisState
&state)
const
{
38
return
success();
39
}
40
41
LogicalResult bufferize(
Operation
*op,
RewriterBase
&rewriter,
42
const
BufferizationOptions
&
options
,
43
BufferizationState
&state)
const
{
44
// The operands of this op are bufferized together with the block signature.
45
return
success();
46
}
47
};
48
49
/// Bufferization of cf.br.
50
struct
BranchOpInterface
51
:
public
BranchLikeOpInterface<BranchOpInterface, cf::BranchOp> {};
52
53
/// Bufferization of cf.cond_br.
54
struct
CondBranchOpInterface
55
:
public
BranchLikeOpInterface<CondBranchOpInterface, cf::CondBranchOp> {};
56
57
}
// namespace
58
}
// namespace cf
59
}
// namespace mlir
60
61
void
mlir::cf::registerBufferizableOpInterfaceExternalModels
(
62
DialectRegistry
®istry) {
63
registry.
addExtension
(+[](
MLIRContext
*ctx, cf::ControlFlowDialect *dialect) {
64
cf::BranchOp::attachInterface<BranchOpInterface>(*ctx);
65
cf::CondBranchOp::attachInterface<CondBranchOpInterface>(*ctx);
66
});
67
}
ControlFlowOps.h
BufferizableOpInterfaceImpl.h
Operation.h
options
static llvm::ManagedStatic< PassManagerOptions > options
Definition:
PassManagerOptions.cpp:89
UnstructuredControlFlow.h
mlir::AnalysisState
Base class for generic analysis states.
Definition:
DataFlowFramework.h:510
mlir::DialectRegistry
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
Definition:
DialectRegistry.h:139
mlir::DialectRegistry::addExtension
bool addExtension(TypeID extensionID, std::unique_ptr< DialectExtensionBase > extension)
Add the given extension to the registry.
Definition:
DialectRegistry.h:215
mlir::MLIRContext
MLIRContext is the top-level object for a collection of MLIR operations.
Definition:
MLIRContext.h:60
mlir::OpOperand
This class represents an operand of an operation.
Definition:
Value.h:257
mlir::Operation
Operation is the basic unit of execution within MLIR.
Definition:
Operation.h:88
mlir::RewriterBase
This class coordinates the application of a rewrite on a set of IR, providing a way for clients to tr...
Definition:
PatternMatch.h:358
mlir::bufferization::BufferizationState
BufferizationState provides information about the state of the IR during the bufferization process.
Definition:
BufferizableOpInterface.h:584
mlir::bufferization
Definition:
BufferDeallocationOpInterface.h:18
mlir::cf::registerBufferizableOpInterfaceExternalModels
void registerBufferizableOpInterfaceExternalModels(DialectRegistry ®istry)
Definition:
BufferizableOpInterfaceImpl.cpp:61
mlir
Include the generated interface declarations.
Definition:
LocalAliasAnalysis.h:20
mlir::bufferization::BranchOpBufferizableOpInterfaceExternalModel
A template that provides a default implementation of getAliasingValues for ops that implement the Bra...
Definition:
UnstructuredControlFlow.h:140
mlir::bufferization::BufferizationOptions
Options for BufferizableOpInterface-based bufferization.
Definition:
BufferizableOpInterface.h:253
Generated on Sat Jul 26 2025 16:32:45 for MLIR by
1.9.1