23#include <mlir/CAPI/IR.h>
24#include <mlir/IR/OperationSupport.h>
25#include <mlir/IR/ValueRange.h>
27#define LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD(dialect, op, suffix, ...) \
28 MlirOperation llzk##dialect##_##op##Build##suffix( \
29 MlirOpBuilder builder, MlirLocation location, __VA_ARGS__ \
31#define LLZK_DEFINE_OP_BUILD_METHOD(dialect, op, ...) \
32 LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD(dialect, op, , __VA_ARGS__)
38static inline int64_t wrap(
const llvm::APInt &cpp) {
return llzk::fromAPInt(cpp); }
40static inline llvm::APInt unwrap(int64_t c) {
return llzk::toAPInt(c); }
42static inline MlirNamedAttribute wrap(mlir::NamedAttribute attr) {
43 return MlirNamedAttribute {wrap(attr.getName()), wrap(attr.getValue())};
46static inline mlir::NamedAttribute unwrap(MlirNamedAttribute attr) {
47 return mlir::NamedAttribute(unwrap(attr.name), unwrap(attr.attribute));
65 storage.resize(nMapOperands);
66 ranges.reserve(nMapOperands);
68 for (intptr_t i = 0; i < nMapOperands; i++) {
69 mlir::SmallVector<mlir::Value, N> &sto = storage[i];
71 ranges.push_back(mlir::ValueRange(unwrapList(ops.
size, ops.
values, sto)));
75 mlir::ArrayRef<mlir::ValueRange>
operator*()
const {
return ranges; }
78 mlir::SmallVector<mlir::SmallVector<mlir::Value, N>, N> storage;
79 mlir::SmallVector<mlir::ValueRange, N> ranges;
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable from
mlir::ArrayRef< mlir::ValueRange > operator*() const
MapOperandsHelper(intptr_t nMapOperands, MlirValueRange const *mapOperands)
constexpr int DEFAULT_ELTS
APInt toAPInt(const DynamicAPInt &val, unsigned bitWidth)
int64_t fromAPInt(const llvm::APInt &i)
auto unwrap_cast(auto &from)
Representation of an mlir::ValueRange
MlirValue const * values
Pointer to the first value in the range.
intptr_t size
Number of values in the range.