MLIR
24.0.0git
include
mlir
Dialect
LLVMIR
LLVMAggregateOps.h
Go to the documentation of this file.
1
//===- LLVMAggregateOps.h - LLVM dialect aggregate ops ----------*- 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 the ops of op partition `Aggregate` of the LLVM dialect.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef MLIR_DIALECT_LLVMIR_LLVMAGGREGATEOPS_H_
14
#define MLIR_DIALECT_LLVMIR_LLVMAGGREGATEOPS_H_
15
16
#include "
mlir/Dialect/LLVMIR/LLVMDialectDecl.h
"
17
18
#define GET_OP_CLASSES
19
#include "mlir/Dialect/LLVMIR/LLVMAggregateOps.h.inc"
20
21
namespace
mlir
{
22
namespace
LLVM {
23
/// Convert an array of integer attributes to a vector of integers that can be
24
/// used as indices in LLVM operations.
25
template
<
typename
IntT =
int
64_t>
26
SmallVector<IntT>
convertArrayToIndices
(
ArrayRef<Attribute>
attrs) {
27
SmallVector<IntT>
indices
;
28
indices
.reserve(attrs.size());
29
for
(
Attribute
attr : attrs)
30
indices
.push_back(cast<IntegerAttr>(attr).getInt());
31
return
indices
;
32
}
33
34
/// Convert an `ArrayAttr` of integer attributes to a vector of integers that
35
/// can be used as indices in LLVM operations.
36
template
<
typename
IntT =
int
64_t>
37
SmallVector<IntT>
convertArrayToIndices
(
ArrayAttr
attrs) {
38
return
convertArrayToIndices<IntT>
(attrs.getValue());
39
}
40
}
// namespace LLVM
41
}
// namespace mlir
42
43
#endif
// MLIR_DIALECT_LLVMIR_LLVMAGGREGATEOPS_H_
indices
indices
Definition
AffineAnalysis.cpp:280
LLVMDialectDecl.h
ArrayAttr
ArrayAttr()
llvm::ArrayRef
Definition
LLVM.h:40
llvm::SmallVector
Definition
LLVM.h:67
mlir::Attribute
Attributes are known-constant values of operations.
Definition
Attributes.h:25
mlir::LLVM::convertArrayToIndices
SmallVector< IntT > convertArrayToIndices(ArrayRef< Attribute > attrs)
Convert an array of integer attributes to a vector of integers that can be used as indices in LLVM op...
Definition
LLVMAggregateOps.h:26
mlir
Include the generated interface declarations.
Definition
ABIRewriteContext.h:32
Generated on
for MLIR by
1.14.0