MLIR 24.0.0git
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
17
18#define GET_OP_CLASSES
19#include "mlir/Dialect/LLVMIR/LLVMAggregateOps.h.inc"
20
21namespace mlir {
22namespace LLVM {
23/// Convert an array of integer attributes to a vector of integers that can be
24/// used as indices in LLVM operations.
25template <typename IntT = int64_t>
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.
36template <typename IntT = int64_t>
40} // namespace LLVM
41} // namespace mlir
42
43#endif // MLIR_DIALECT_LLVMIR_LLVMAGGREGATEOPS_H_
ArrayAttr()
Attributes are known-constant values of operations.
Definition Attributes.h:25
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...
Include the generated interface declarations.