MLIR
21.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
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
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
IR
AffineMapDetail.h
Go to the documentation of this file.
1
//===- AffineMapDetail.h - MLIR Affine Map details Class --------*- 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 holds implementation details of AffineMap.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef AFFINEMAPDETAIL_H_
14
#define AFFINEMAPDETAIL_H_
15
16
#include "
mlir/IR/AffineExpr.h
"
17
#include "
mlir/IR/AffineMap.h
"
18
#include "
mlir/Support/StorageUniquer.h
"
19
#include "llvm/ADT/ArrayRef.h"
20
#include "llvm/Support/TrailingObjects.h"
21
22
namespace
mlir
{
23
namespace
detail {
24
25
struct
AffineMapStorage
final
26
:
public
StorageUniquer::BaseStorage
,
27
private
llvm::TrailingObjects<AffineMapStorage, AffineExpr> {
28
friend
llvm::TrailingObjects<AffineMapStorage, AffineExpr>;
29
30
/// The hash key used for uniquing.
31
using
KeyTy
= std::tuple<unsigned, unsigned, ArrayRef<AffineExpr>>;
32
33
unsigned
numDims
;
34
unsigned
numSymbols
;
35
unsigned
numResults
;
36
37
MLIRContext
*
context
;
38
39
/// The affine expressions for this (multi-dimensional) map.
40
ArrayRef<AffineExpr>
results
()
const
{
41
return
getTrailingObjects(
numResults
);
42
}
43
44
bool
operator==
(
const
KeyTy
&key)
const
{
45
return
std::get<0>(key) ==
numDims
&& std::get<1>(key) ==
numSymbols
&&
46
std::get<2>(key) ==
results
();
47
}
48
49
// Constructs an AffineMapStorage from a key. The context must be set by the
50
// caller.
51
static
AffineMapStorage
*
52
construct
(
StorageUniquer::StorageAllocator
&allocator,
const
KeyTy
&key) {
53
auto
results
= std::get<2>(key);
54
auto
byteSize =
55
AffineMapStorage::totalSizeToAlloc<AffineExpr>(
results
.size());
56
auto
*rawMem = allocator.
allocate
(byteSize,
alignof
(
AffineMapStorage
));
57
auto
*res =
new
(rawMem)
AffineMapStorage
();
58
res->
numDims
= std::get<0>(key);
59
res->numSymbols = std::get<1>(key);
60
res->numResults =
results
.size();
61
llvm::uninitialized_copy(
results
, res->getTrailingObjects());
62
return
res;
63
}
64
};
65
66
}
// namespace detail
67
}
// namespace mlir
68
69
#endif
// AFFINEMAPDETAIL_H_
StorageUniquer.h
llvm::ArrayRef
Definition:
LLVM.h:48
mlir::MLIRContext
MLIRContext is the top-level object for a collection of MLIR operations.
Definition:
MLIRContext.h:60
mlir::StorageUniquer::BaseStorage
This class acts as the base storage that all storage classes must derived from.
Definition:
StorageUniquer.h:86
mlir::StorageUniquer::StorageAllocator
This is a utility allocator used to allocate memory for instances of derived types.
Definition:
StorageUniquer.h:93
mlir::StorageUniquer::StorageAllocator::allocate
T * allocate()
Allocate an instance of the provided type.
Definition:
StorageUniquer.h:120
AffineExpr.h
AffineMap.h
mlir
Include the generated interface declarations.
Definition:
LocalAliasAnalysis.h:20
mlir::detail::AffineMapStorage
Definition:
AffineMapDetail.h:27
mlir::detail::AffineMapStorage::numDims
unsigned numDims
Definition:
AffineMapDetail.h:33
mlir::detail::AffineMapStorage::numSymbols
unsigned numSymbols
Definition:
AffineMapDetail.h:34
mlir::detail::AffineMapStorage::results
ArrayRef< AffineExpr > results() const
The affine expressions for this (multi-dimensional) map.
Definition:
AffineMapDetail.h:40
mlir::detail::AffineMapStorage::context
MLIRContext * context
Definition:
AffineMapDetail.h:37
mlir::detail::AffineMapStorage::operator==
bool operator==(const KeyTy &key) const
Definition:
AffineMapDetail.h:44
mlir::detail::AffineMapStorage::KeyTy
std::tuple< unsigned, unsigned, ArrayRef< AffineExpr > > KeyTy
The hash key used for uniquing.
Definition:
AffineMapDetail.h:31
mlir::detail::AffineMapStorage::numResults
unsigned numResults
Definition:
AffineMapDetail.h:35
mlir::detail::AffineMapStorage::construct
static AffineMapStorage * construct(StorageUniquer::StorageAllocator &allocator, const KeyTy &key)
Definition:
AffineMapDetail.h:52
Generated on Mon Jun 9 2025 20:32:31 for MLIR by
1.9.1