29 ::mlir::OpOperand &(*getArrRefMutable)(
const Concept *
impl, ::mlir::Operation *);
31 template<
typename ConcreteOp>
37 static inline ::mlir::TypedValue<::llzk::array::ArrayType>
getArrRef(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val);
40 template<
typename ConcreteOp>
46 static inline ::mlir::TypedValue<::llzk::array::ArrayType>
getArrRef(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val);
49 template<
typename ConcreteModel,
typename ConcreteOp>
55template <
typename ConcreteOp>
59class ArrayRefOpInterface :
public ::mlir::OpInterface<ArrayRefOpInterface, detail::ArrayRefOpInterfaceInterfaceTraits> {
61 using ::mlir::OpInterface<ArrayRefOpInterface, detail::ArrayRefOpInterfaceInterfaceTraits>::OpInterface;
62 template <
typename ConcreteOp>
66 ::mlir::TypedValue<::llzk::array::ArrayType>
getArrRef();
91 assert(
implArrayRefOpInterface &&
"`::llzk::array::ArrayAccessOpInterface` expected its base interface `::llzk::array::ArrayRefOpInterface` to be registered");
94 template<
typename ConcreteOp>
100 static inline ::mlir::Operation::operand_range
getIndices(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val);
102 static inline bool isRead(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val);
104 template<
typename ConcreteOp>
110 static inline ::mlir::Operation::operand_range
getIndices(
const Concept *
impl, ::mlir::Operation *tablegen_opaque_val);
114 template<
typename ConcreteModel,
typename ConcreteOp>
120template <
typename ConcreteOp>
124class ArrayAccessOpInterface :
public ::mlir::OpInterface<ArrayAccessOpInterface, detail::ArrayAccessOpInterfaceInterfaceTraits> {
126 using ::mlir::OpInterface<ArrayAccessOpInterface, detail::ArrayAccessOpInterfaceInterfaceTraits>::OpInterface;
127 template <
typename ConcreteOp>
131 ::mlir::Operation::operand_range
getIndices();
151 bool canRewire(const ::mlir::DestructurableMemorySlot &slot,
152 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
153 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
154 const ::mlir::DataLayout &dataLayout);
157 ::mlir::DeletionKind
rewire(const ::mlir::DestructurableMemorySlot &slot,
158 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
159 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout);
162 static ::llvm::SmallVector<::mlir::Value>
163 genIndexConstants(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::ArrayAttr index);
167 genRead(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef,
168 ::mlir::ValueRange indices);
172 genRead(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef,
173 ::mlir::ArrayAttr index);
176 static void genWrite(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef,
177 ::mlir::ValueRange indices, ::mlir::Value value);
180 static void genWrite(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef,
181 ::mlir::ArrayAttr index, ::mlir::Value value);
186 operator ::llzk::array::ArrayRefOpInterface ()
const {
187 if (!*
this)
return nullptr;
188 return ::llzk::array::ArrayRefOpInterface(*
this, getImpl()->implArrayRefOpInterface);
193 ::mlir::TypedValue<::llzk::array::ArrayType>
getArrRef();
205 template <
typename ConcreteOp>
206 struct ArrayRefOpInterfaceTrait :
public ::mlir::OpInterface<ArrayRefOpInterface, detail::ArrayRefOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
212 template <
typename ConcreteOp>
213 struct ArrayAccessOpInterfaceTrait :
public ::mlir::OpInterface<ArrayAccessOpInterface, detail::ArrayAccessOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
219template<
typename ConcreteOp>
221 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getArrRef();
223template<
typename ConcreteOp>
225 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getArrRefMutable();
227template<
typename ConcreteOp>
229 return static_cast<const ConcreteOp *
>(
impl)->
getArrRef(tablegen_opaque_val);
231template<
typename ConcreteOp>
239template<
typename ConcreteOp>
241 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getIndices();
243template<
typename ConcreteOp>
245 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).getIndicesMutable();
247template<
typename ConcreteOp>
249 return (llvm::cast<ConcreteOp>(tablegen_opaque_val)).isRead();
251template<
typename ConcreteOp>
253 return static_cast<const ConcreteOp *
>(
impl)->
getIndices(tablegen_opaque_val);
255template<
typename ConcreteOp>
259template<
typename ConcreteOp>
261 return static_cast<const ConcreteOp *
>(
impl)->
isRead(tablegen_opaque_val);
::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot > &subslots, ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout)
Required by companion interface DestructurableAccessorOpInterface / SROA pass.
static void genWrite(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef, ::mlir::ValueRange indices, ::mlir::Value value)
Create an array.write or array.insert for one concrete element or subarray.
::mlir::Operation::operand_range getIndices()
Gets the operand range containing the index for each dimension.
::mlir::Value genRead(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef, ::mlir::ArrayAttr index)
Create an array.read or array.extract for one concrete element or subarray.
::mlir::OpOperand & getArrRefMutable()
Gets the mutable operand slot holding the SSA Value for the referenced array.
::mlir::Value genRead(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef, ::mlir::ValueRange indices)
Create an array.read or array.extract for one concrete element or subarray.
bool isRead()
Return true if the op is a read, false if it's a write.
static void genWrite(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::Value arrayRef, ::mlir::ArrayAttr index, ::mlir::Value value)
Create an array.write or array.insert for one concrete element or subarray.
inline ::mlir::ArrayRef<::mlir::Attribute > getValueOperandDims()
Compute the dimensions of the read/write value.
::mlir::ArrayAttr indexOperandsToAttributeArray()
Returns the multi-dimensional indices of the array access as an Attribute array or a null pointer if ...
static ::llvm::SmallVector<::mlir::Value > genIndexConstants(::mlir::OpBuilder &bldr, ::mlir::Location loc, ::mlir::ArrayAttr index)
Generate arith.constant indices for one static array element position.
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
Gets the SSA Value for the referenced array.
bool canRewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::SmallPtrSetImpl<::mlir::Attribute > &usedIndices, ::mlir::SmallVectorImpl<::mlir::MemorySlot > &mustBeSafelyUsed, const ::mlir::DataLayout &dataLayout)
Required by companion interface DestructurableAccessorOpInterface / SROA pass.
inline ::llzk::array::ArrayType getArrRefType()
Gets the type of the referenced array.
::mlir::MutableOperandRange getIndicesMutable()
Gets the mutable operand range containing the index for each dimension.
::mlir::OpOperand & getArrRefMutable()
Gets the mutable operand slot holding the SSA Value for the referenced array.
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
Gets the SSA Value for the referenced array.
inline ::llzk::array::ArrayType getArrRefType()
Gets the type of the referenced array.
::llvm::ArrayRef<::mlir::Attribute > getDimensionSizes() const
ConcreteOp ConcreteEntity
static bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
::llzk::array::ArrayAccessOpInterface Interface
static inline ::mlir::MutableOperandRange getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::Operation::operand_range getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::MutableOperandRange getIndicesMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::Operation::operand_range getIndices(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
::llzk::array::ArrayAccessOpInterface Interface
static bool isRead(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
ConcreteOp ConcreteEntity
::llzk::array::ArrayRefOpInterface Interface
static inline ::mlir::OpOperand & getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::TypedValue<::llzk::array::ArrayType > getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::OpOperand & getArrRefMutable(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
static inline ::mlir::TypedValue<::llzk::array::ArrayType > getArrRef(const Concept *impl, ::mlir::Operation *tablegen_opaque_val)
::llzk::array::ArrayRefOpInterface Interface
Common interface for operations that reference an array value.
void initializeInterfaceConcept(::mlir::detail::InterfaceMap &interfaceMap)
bool(* isRead)(const Concept *impl, ::mlir::Operation *)
::mlir::Operation::operand_range(* getIndices)(const Concept *impl, ::mlir::Operation *)
The methods defined by the interface.
::mlir::MutableOperandRange(* getIndicesMutable)(const Concept *impl, ::mlir::Operation *)
const ::llzk::array::ArrayRefOpInterface::Concept * implArrayRefOpInterface
The base classes of this interface.
::mlir::TypedValue<::llzk::array::ArrayType >(* getArrRef)(const Concept *impl, ::mlir::Operation *)
The methods defined by the interface.
::mlir::OpOperand &(* getArrRefMutable)(const Concept *impl, ::mlir::Operation *)