My Project
AffineOps.h
Go to the documentation of this file.
1 //===- AffineOps.h - MLIR Affine Operations -------------------------------===//
2 //
3 // Part of the MLIR 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 defines convenience types for working with Affine operations
10 // in the MLIR operation set.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MLIR_DIALECT_AFFINEOPS_AFFINEOPS_H
15 #define MLIR_DIALECT_AFFINEOPS_AFFINEOPS_H
16 
17 #include "mlir/IR/AffineMap.h"
18 #include "mlir/IR/Builders.h"
19 #include "mlir/IR/Dialect.h"
20 #include "mlir/IR/OpDefinition.h"
21 #include "mlir/IR/StandardTypes.h"
23 
24 namespace mlir {
25 class AffineBound;
26 class AffineDimExpr;
27 class AffineValueMap;
28 class AffineTerminatorOp;
29 class FlatAffineConstraints;
30 class OpBuilder;
31 
35 bool isTopLevelValue(Value value);
36 
37 class AffineOpsDialect : public Dialect {
38 public:
39  AffineOpsDialect(MLIRContext *context);
40  static StringRef getDialectNamespace() { return "affine"; }
41 
44  Operation *materializeConstant(OpBuilder &builder, Attribute value, Type type,
45  Location loc) override;
46 };
47 
62 class AffineApplyOp : public Op<AffineApplyOp, OpTrait::VariadicOperands,
63  OpTrait::OneResult, OpTrait::HasNoSideEffect> {
64 public:
65  using Op::Op;
66 
68  static void build(Builder *builder, OperationState &result, AffineMap map,
69  ValueRange operands);
70 
73  return getAttrOfType<AffineMapAttr>("map").getValue();
74  }
75 
77  bool isValidDim();
78 
80  bool isValidSymbol();
81 
82  static StringRef getOperationName() { return "affine.apply"; }
83 
84  operand_range getMapOperands() { return getOperands(); }
85 
86  // Hooks to customize behavior of this op.
87  static ParseResult parse(OpAsmParser &parser, OperationState &result);
88  void print(OpAsmPrinter &p);
90  OpFoldResult fold(ArrayRef<Attribute> operands);
91 
92  static void getCanonicalizationPatterns(OwningRewritePatternList &results,
93  MLIRContext *context);
94 };
95 
114 //
115 // For example, a DmaStartOp operation that transfers 256 elements of a memref
116 // '%src' in memory space 0 at indices [%i + 3, %j] to memref '%dst' in memory
117 // space 1 at indices [%k + 7, %l], would be specified as follows:
118 //
119 // %num_elements = constant 256
120 // %idx = constant 0 : index
121 // %tag = alloc() : memref<1xi32, 4>
122 // affine.dma_start %src[%i + 3, %j], %dst[%k + 7, %l], %tag[%idx],
123 // %num_elements :
124 // memref<40x128xf32, 0>, memref<2x1024xf32, 1>, memref<1xi32, 2>
125 //
126 // If %stride and %num_elt_per_stride are specified, the DMA is expected to
127 // transfer %num_elt_per_stride elements every %stride elements apart from
128 // memory space 0 until %num_elements are transferred.
129 //
130 // affine.dma_start %src[%i, %j], %dst[%k, %l], %tag[%idx], %num_elements,
131 // %stride, %num_elt_per_stride : ...
132 //
133 // TODO(mlir-team): add additional operands to allow source and destination
134 // striding, and multiple stride levels (possibly using AffineMaps to specify
135 // multiple levels of striding).
136 // TODO(andydavis) Consider replacing src/dst memref indices with view memrefs.
137 class AffineDmaStartOp : public Op<AffineDmaStartOp, OpTrait::VariadicOperands,
138  OpTrait::ZeroResult> {
139 public:
140  using Op::Op;
141 
142  static void build(Builder *builder, OperationState &result, Value srcMemRef,
143  AffineMap srcMap, ValueRange srcIndices, Value destMemRef,
144  AffineMap dstMap, ValueRange destIndices, Value tagMemRef,
145  AffineMap tagMap, ValueRange tagIndices, Value numElements,
146  Value stride = nullptr, Value elementsPerStride = nullptr);
147 
149  unsigned getSrcMemRefOperandIndex() { return 0; }
150 
152  Value getSrcMemRef() { return getOperand(getSrcMemRefOperandIndex()); }
154  return getSrcMemRef()->getType().cast<MemRefType>();
155  }
156 
158  unsigned getSrcMemRefRank() { return getSrcMemRefType().getRank(); }
159 
161  AffineMap getSrcMap() { return getSrcMapAttr().getValue(); }
163  return getAttr(getSrcMapAttrName()).cast<AffineMapAttr>();
164  }
165 
168  return {operand_begin() + getSrcMemRefOperandIndex() + 1,
169  operand_begin() + getSrcMemRefOperandIndex() + 1 +
170  getSrcMap().getNumInputs()};
171  }
172 
174  unsigned getSrcMemorySpace() {
175  return getSrcMemRef()->getType().cast<MemRefType>().getMemorySpace();
176  }
177 
180  return getSrcMemRefOperandIndex() + 1 + getSrcMap().getNumInputs();
181  }
182 
184  Value getDstMemRef() { return getOperand(getDstMemRefOperandIndex()); }
186  return getDstMemRef()->getType().cast<MemRefType>();
187  }
188 
190  unsigned getDstMemRefRank() {
191  return getDstMemRef()->getType().cast<MemRefType>().getRank();
192  }
193 
195  unsigned getDstMemorySpace() {
196  return getDstMemRef()->getType().cast<MemRefType>().getMemorySpace();
197  }
198 
200  AffineMap getDstMap() { return getDstMapAttr().getValue(); }
202  return getAttr(getDstMapAttrName()).cast<AffineMapAttr>();
203  }
204 
207  return {operand_begin() + getDstMemRefOperandIndex() + 1,
208  operand_begin() + getDstMemRefOperandIndex() + 1 +
209  getDstMap().getNumInputs()};
210  }
211 
214  return getDstMemRefOperandIndex() + 1 + getDstMap().getNumInputs();
215  }
216 
218  Value getTagMemRef() { return getOperand(getTagMemRefOperandIndex()); }
220  return getTagMemRef()->getType().cast<MemRefType>();
221  }
222 
224  unsigned getTagMemRefRank() {
225  return getTagMemRef()->getType().cast<MemRefType>().getRank();
226  }
227 
229  AffineMap getTagMap() { return getTagMapAttr().getValue(); }
231  return getAttr(getTagMapAttrName()).cast<AffineMapAttr>();
232  }
233 
236  return {operand_begin() + getTagMemRefOperandIndex() + 1,
237  operand_begin() + getTagMemRefOperandIndex() + 1 +
238  getTagMap().getNumInputs()};
239  }
240 
243  return getOperand(getTagMemRefOperandIndex() + 1 +
244  getTagMap().getNumInputs());
245  }
246 
249  if (memref == getSrcMemRef())
250  return {Identifier::get(getSrcMapAttrName(), getContext()),
251  getSrcMapAttr()};
252  else if (memref == getDstMemRef())
253  return {Identifier::get(getDstMapAttrName(), getContext()),
254  getDstMapAttr()};
255  assert(memref == getTagMemRef() &&
256  "DmaStartOp expected source, destination or tag memref");
257  return {Identifier::get(getTagMapAttrName(), getContext()),
258  getTagMapAttr()};
259  }
260 
263  return (getSrcMemorySpace() < getDstMemorySpace());
264  }
265 
268  // Assumes that a lower number is for a slower memory space.
269  return (getDstMemorySpace() < getSrcMemorySpace());
270  }
271 
275  unsigned getFasterMemPos() {
276  assert(isSrcMemorySpaceFaster() || isDestMemorySpaceFaster());
277  return isSrcMemorySpaceFaster() ? 0 : getDstMemRefOperandIndex();
278  }
279 
280  static StringRef getSrcMapAttrName() { return "src_map"; }
281  static StringRef getDstMapAttrName() { return "dst_map"; }
282  static StringRef getTagMapAttrName() { return "tag_map"; }
283 
284  static StringRef getOperationName() { return "affine.dma_start"; }
285  static ParseResult parse(OpAsmParser &parser, OperationState &result);
286  void print(OpAsmPrinter &p);
288  LogicalResult fold(ArrayRef<Attribute> cstOperands,
290 
292  bool isStrided() {
293  return getNumOperands() !=
294  getTagMemRefOperandIndex() + 1 + getTagMap().getNumInputs() + 1;
295  }
296 
299  if (!isStrided())
300  return nullptr;
301  return getOperand(getNumOperands() - 1 - 1);
302  }
303 
306  if (!isStrided())
307  return nullptr;
308  return getOperand(getNumOperands() - 1);
309  }
310 };
311 
318 //
319 // affine.dma_start %src[%i, %j], %dst[%k, %l], %tag[%index], %num_elements :
320 // memref<2048xf32, 0>, memref<256xf32, 1>, memref<1xi32, 2>
321 // ...
322 // ...
323 // affine.dma_wait %tag[%index], %num_elements : memref<1xi32, 2>
324 //
325 class AffineDmaWaitOp : public Op<AffineDmaWaitOp, OpTrait::VariadicOperands,
326  OpTrait::ZeroResult> {
327 public:
328  using Op::Op;
329 
330  static void build(Builder *builder, OperationState &result, Value tagMemRef,
331  AffineMap tagMap, ValueRange tagIndices, Value numElements);
332 
333  static StringRef getOperationName() { return "affine.dma_wait"; }
334 
335  // Returns the Tag MemRef associated with the DMA operation being waited on.
336  Value getTagMemRef() { return getOperand(0); }
338  return getTagMemRef()->getType().cast<MemRefType>();
339  }
340 
342  AffineMap getTagMap() { return getTagMapAttr().getValue(); }
344  return getAttr(getTagMapAttrName()).cast<AffineMapAttr>();
345  }
346 
347  // Returns the tag memref index for this DMA operation.
349  return {operand_begin() + 1,
350  operand_begin() + 1 + getTagMap().getNumInputs()};
351  }
352 
353  // Returns the rank (number of indices) of the tag memref.
354  unsigned getTagMemRefRank() {
355  return getTagMemRef()->getType().cast<MemRefType>().getRank();
356  }
357 
360  assert(memref == getTagMemRef());
361  return {Identifier::get(getTagMapAttrName(), getContext()),
362  getTagMapAttr()};
363  }
364 
366  Value getNumElements() { return getOperand(1 + getTagMap().getNumInputs()); }
367 
368  static StringRef getTagMapAttrName() { return "tag_map"; }
369  static ParseResult parse(OpAsmParser &parser, OperationState &result);
370  void print(OpAsmPrinter &p);
372  LogicalResult fold(ArrayRef<Attribute> cstOperands,
374 };
375 
382 //
383 // Example 1:
384 //
385 // %1 = affine.load %0[%i0 + 3, %i1 + 7] : memref<100x100xf32>
386 //
387 // Example 2: Uses 'symbol' keyword for symbols '%n' and '%m'.
388 //
389 // %1 = affine.load %0[%i0 + symbol(%n), %i1 + symbol(%m)]
390 // : memref<100x100xf32>
391 //
392 class AffineLoadOp : public Op<AffineLoadOp, OpTrait::OneResult,
393  OpTrait::AtLeastNOperands<1>::Impl> {
394 public:
395  using Op::Op;
396 
398  static void build(Builder *builder, OperationState &result, AffineMap map,
399  ValueRange operands);
401  static void build(Builder *builder, OperationState &result, Value memref,
402  ValueRange indices = {});
404  static void build(Builder *builder, OperationState &result, Value memref,
405  AffineMap map, ValueRange mapOperands);
406 
408  unsigned getMemRefOperandIndex() { return 0; }
409 
411  Value getMemRef() { return getOperand(getMemRefOperandIndex()); }
412  void setMemRef(Value value) { setOperand(getMemRefOperandIndex(), value); }
414  return getMemRef()->getType().cast<MemRefType>();
415  }
416 
418  operand_range getMapOperands() { return llvm::drop_begin(getOperands(), 1); }
419 
421  AffineMap getAffineMap() { return getAffineMapAttr().getValue(); }
423  return getAttr(getMapAttrName()).cast<AffineMapAttr>();
424  }
425 
428  assert(memref == getMemRef());
429  return {Identifier::get(getMapAttrName(), getContext()),
430  getAffineMapAttr()};
431  }
432 
433  static StringRef getMapAttrName() { return "map"; }
434  static StringRef getOperationName() { return "affine.load"; }
435 
436  // Hooks to customize behavior of this op.
437  static ParseResult parse(OpAsmParser &parser, OperationState &result);
438  void print(OpAsmPrinter &p);
440  static void getCanonicalizationPatterns(OwningRewritePatternList &results,
441  MLIRContext *context);
442  OpFoldResult fold(ArrayRef<Attribute> operands);
443 };
444 
451 //
452 // Example 1:
453 //
454 // affine.store %v0, %0[%i0 + 3, %i1 + 7] : memref<100x100xf32>
455 //
456 // Example 2: Uses 'symbol' keyword for symbols '%n' and '%m'.
457 //
458 // affine.store %v0, %0[%i0 + symbol(%n), %i1 + symbol(%m)]
459 // : memref<100x100xf32>
460 //
461 class AffineStoreOp : public Op<AffineStoreOp, OpTrait::ZeroResult,
462  OpTrait::AtLeastNOperands<1>::Impl> {
463 public:
464  using Op::Op;
465 
467  static void build(Builder *builder, OperationState &result,
468  Value valueToStore, Value memref, ValueRange indices);
470  static void build(Builder *builder, OperationState &result,
471  Value valueToStore, Value memref, AffineMap map,
472  ValueRange mapOperands);
473 
475  Value getValueToStore() { return getOperand(0); }
476 
478  unsigned getMemRefOperandIndex() { return 1; }
479 
481  Value getMemRef() { return getOperand(getMemRefOperandIndex()); }
482  void setMemRef(Value value) { setOperand(getMemRefOperandIndex(), value); }
483 
485  return getMemRef()->getType().cast<MemRefType>();
486  }
487 
489  operand_range getMapOperands() { return llvm::drop_begin(getOperands(), 2); }
490 
492  AffineMap getAffineMap() { return getAffineMapAttr().getValue(); }
494  return getAttr(getMapAttrName()).cast<AffineMapAttr>();
495  }
496 
499  assert(memref == getMemRef());
500  return {Identifier::get(getMapAttrName(), getContext()),
501  getAffineMapAttr()};
502  }
503 
504  static StringRef getMapAttrName() { return "map"; }
505  static StringRef getOperationName() { return "affine.store"; }
506 
507  // Hooks to customize behavior of this op.
508  static ParseResult parse(OpAsmParser &parser, OperationState &result);
509  void print(OpAsmPrinter &p);
511  static void getCanonicalizationPatterns(OwningRewritePatternList &results,
512  MLIRContext *context);
513  LogicalResult fold(ArrayRef<Attribute> cstOperands,
515 };
516 
518 bool isValidDim(Value value);
519 
521 bool isValidSymbol(Value value);
522 
530  SmallVectorImpl<Value> *operands);
534  SmallVectorImpl<Value> *operands);
535 
540  ArrayRef<Value> operands);
541 
550  SmallVectorImpl<Value> *operands);
551 
552 #define GET_OP_CLASSES
553 #include "mlir/Dialect/AffineOps/AffineOps.h.inc"
554 
556 bool isForInductionVar(Value val);
557 
560 AffineForOp getForInductionVarOwner(Value val);
561 
564 void extractForInductionVars(ArrayRef<AffineForOp> forInsts,
565  SmallVectorImpl<Value> *ivs);
566 
571 class AffineBound {
572 public:
573  AffineForOp getAffineForOp() { return op; }
574  AffineMap getMap() { return map; }
575 
577  AffineValueMap getAsAffineValueMap();
578 
579  unsigned getNumOperands() { return opEnd - opStart; }
580  Value getOperand(unsigned idx) { return op.getOperand(opStart + idx); }
581 
582  using operand_iterator = AffineForOp::operand_iterator;
583  using operand_range = AffineForOp::operand_range;
584 
585  operand_iterator operand_begin() { return op.operand_begin() + opStart; }
586  operand_iterator operand_end() { return op.operand_begin() + opEnd; }
587  operand_range getOperands() { return {operand_begin(), operand_end()}; }
588 
589 private:
590  // 'affine.for' operation that contains this bound.
591  AffineForOp op;
592  // Start and end positions of this affine bound operands in the list of
593  // the containing 'affine.for' operation operands.
594  unsigned opStart, opEnd;
595  // Affine map for this bound.
596  AffineMap map;
597 
598  AffineBound(AffineForOp op, unsigned opStart, unsigned opEnd, AffineMap map)
599  : op(op), opStart(opStart), opEnd(opEnd), map(map) {}
600 
601  friend class AffineForOp;
602 };
603 
619 
621  AffineMap getAffineMap() { return affineMap; }
622 
624  SmallVector<Value, 8> res(reorderedDims);
625  res.append(concatenatedSymbols.begin(), concatenatedSymbols.end());
626  return res;
627  }
628 
629  unsigned getNumSymbols() { return concatenatedSymbols.size(); }
630  unsigned getNumDims() { return reorderedDims.size(); }
631 
634  void normalize(AffineMap *otherMap, SmallVectorImpl<Value> *otherOperands);
635 
636 private:
640  AffineDimExpr renumberOneDim(Value v);
641 
646  AffineMap renumber(const AffineApplyNormalizer &other);
647 
649  DenseMap<Value, unsigned> dimValueToPosition;
650 
653  SmallVector<Value, 8> reorderedDims;
654  SmallVector<Value, 8> concatenatedSymbols;
655 
656  AffineMap affineMap;
657 
663  static unsigned &affineApplyDepth() {
664  static thread_local unsigned depth = 0;
665  return depth;
666  }
667  static constexpr unsigned kMaxAffineApplyDepth = 1;
668 
669  AffineApplyNormalizer() { affineApplyDepth()++; }
670 
671 public:
672  ~AffineApplyNormalizer() { affineApplyDepth()--; }
673 };
674 
675 } // end namespace mlir
676 
677 #endif
Definition: InferTypeOpInterface.cpp:20
bool isStrided()
Returns true if this DMA operation is strided, returns false otherwise.
Definition: AffineOps.h:292
AffineApplyOp makeComposedAffineApply(OpBuilder &b, Location loc, AffineMap map, ArrayRef< Value > operands)
Definition: AffineOps.cpp:597
Definition: Operation.h:27
AffineMapAttr getDstMapAttr()
Definition: AffineOps.h:201
static StringRef getOperationName()
Definition: AffineOps.h:505
Value getOperand(unsigned idx)
Definition: AffineOps.h:580
Definition: LLVM.h:48
AffineMap getAffineMap()
Returns the affine map to be applied by this operation.
Definition: AffineOps.h:72
This class represents a single result from folding an operation.
Definition: OpDefinition.h:251
LogicalResult verify(Operation *op)
Definition: Verifier.cpp:264
AffineForOp getAffineForOp()
Definition: AffineOps.h:573
static Identifier get(StringRef str, MLIRContext *context)
Return an identifier for the specified string.
Definition: MLIRContext.cpp:426
void setMemRef(Value value)
Definition: AffineOps.h:482
AffineMap getAffineMap()
Returns the AffineMap resulting from normalization.
Definition: AffineOps.h:621
unsigned getFasterMemPos()
Definition: AffineOps.h:275
operand_range getDstIndices()
Returns the destination memref indices for this DMA operation.
Definition: AffineOps.h:206
unsigned getNumSymbols()
Definition: AffineOps.h:629
NamedAttribute getAffineMapAttrForMemRef(Value memref)
Returns the AffineMapAttr associated with &#39;memref&#39;.
Definition: AffineOps.h:248
static StringRef getOperationName()
Definition: AffineOps.h:284
operand_range getTagIndices()
Returns the tag memref indices for this DMA operation.
Definition: AffineOps.h:235
Definition: OpImplementation.h:214
Value getMemRef()
Get memref operand.
Definition: AffineOps.h:411
unsigned getNumDims()
Definition: AffineOps.h:630
operand_iterator operand_end()
Definition: AffineOps.h:586
Definition: AffineOps.h:392
MemRefType getTagMemRefType()
Definition: AffineOps.h:337
void extractForInductionVars(ArrayRef< AffineForOp > forInsts, SmallVectorImpl< Value > *ivs)
Definition: AffineOps.cpp:1582
Definition: LLVM.h:34
SmallVector< Value, 8 > getOperands()
Definition: AffineOps.h:623
Definition: Location.h:52
std::pair< Identifier, Attribute > NamedAttribute
Definition: Attributes.h:264
AffineOpsDialect(MLIRContext *context)
Definition: AffineOps.cpp:83
NamedAttribute getAffineMapAttrForMemRef(Value memref)
Returns the AffineMapAttr associated with &#39;memref&#39;.
Definition: AffineOps.h:359
Value getNumElementsPerStride()
Returns the number of elements to transfer per stride for this DMA op.
Definition: AffineOps.h:305
AffineForOp::operand_iterator operand_iterator
Definition: AffineOps.h:582
unsigned getDstMemRefRank()
Returns the rank (number of indices) of the destination MemRefType.
Definition: AffineOps.h:190
Value getTagMemRef()
Definition: AffineOps.h:336
Value getNumElements()
Returns the number of elements transferred in the associated DMA op.
Definition: AffineOps.h:366
Definition: LogicalResult.h:18
AffineForOp::operand_range operand_range
Definition: AffineOps.h:583
bool isValidDim(Value value)
Returns true if the given Value can be used as a dimension id.
Definition: AffineOps.cpp:118
Definition: LLVM.h:37
unsigned getNumOperands()
Definition: AffineOps.h:579
static StringRef getDialectNamespace()
Definition: AffineOps.h:40
bool isStrided(MemRefType t)
Return true if the layout for t is compatible with strided semantics.
Definition: StandardTypes.cpp:734
static StringRef getOperationName()
Definition: AffineOps.h:82
Definition: AffineOps.h:62
Value getValueToStore()
Get value to be stored by store operation.
Definition: AffineOps.h:475
static StringRef getMapAttrName()
Definition: AffineOps.h:504
static StringRef getSrcMapAttrName()
Definition: AffineOps.h:280
bool isDestMemorySpaceFaster()
Returns true if this is a DMA from a faster memory space to a slower one.
Definition: AffineOps.h:262
static StringRef getTagMapAttrName()
Definition: AffineOps.h:282
bool isValidSymbol(Value value)
Returns true if the given Value can be used as a symbol.
Definition: AffineOps.cpp:178
operand_range getTagIndices()
Definition: AffineOps.h:348
unsigned getSrcMemRefOperandIndex()
Returns the operand index of the src memref.
Definition: AffineOps.h:149
Value getNumElements()
Returns the number of elements being transferred by this DMA operation.
Definition: AffineOps.h:242
Definition: Attributes.h:53
static StringRef getTagMapAttrName()
Definition: AffineOps.h:368
auto map(Fn fun, IterType begin, IterType end) -> SmallVector< typename std::result_of< Fn(decltype(*begin))>::type, 8 >
Map with iterators.
Definition: Functional.h:28
void fullyComposeAffineMapAndOperands(AffineMap *map, SmallVectorImpl< Value > *operands)
Definition: AffineOps.cpp:588
unsigned getMemRefOperandIndex()
Returns the operand index of the memref.
Definition: AffineOps.h:478
MemRefType getSrcMemRefType()
Definition: AffineOps.h:153
unsigned getMemRefOperandIndex()
Returns the operand index of the memref.
Definition: AffineOps.h:408
static StringRef getMapAttrName()
Definition: AffineOps.h:433
Definition: Dialect.h:39
void canonicalizeMapAndOperands(AffineMap *map, SmallVectorImpl< Value > *operands)
Definition: AffineOps.cpp:730
void canonicalizeSetAndOperands(IntegerSet *set, SmallVectorImpl< Value > *operands)
Definition: AffineOps.cpp:735
Definition: StandardTypes.h:390
Definition: OpImplementation.h:32
unsigned getSrcMemorySpace()
Returns the memory space of the src memref.
Definition: AffineOps.h:174
Definition: OperationSupport.h:261
AffineMapAttr getTagMapAttr()
Definition: AffineOps.h:230
NamedAttribute getAffineMapAttrForMemRef(Value memref)
Returns the AffineMapAttr associated with &#39;memref&#39;.
Definition: AffineOps.h:427
Definition: AffineMap.h:37
bool isForInductionVar(Value val)
Returns if the provided value is the induction variable of a AffineForOp.
Definition: AffineOps.cpp:1566
Definition: AffineOps.h:325
operand_range getMapOperands()
Definition: AffineOps.h:84
NamedAttribute getAffineMapAttrForMemRef(Value memref)
Returns the AffineMapAttr associated with &#39;memref&#39;.
Definition: AffineOps.h:498
MLIRContext * getContext() const
Definition: Dialect.h:47
Definition: AffineOps.h:571
Value getDstMemRef()
Returns the destination MemRefType for this DMA operations.
Definition: AffineOps.h:184
Value getSrcMemRef()
Returns the source MemRefType for this DMA operation.
Definition: AffineOps.h:152
Value getMemRef()
Get memref operand.
Definition: AffineOps.h:481
Definition: AffineOps.h:617
Op()
This is a public constructor. Any op can be initialized to null.
Definition: OpDefinition.h:1029
Value getTagMemRef()
Returns the Tag MemRef for this DMA operation.
Definition: AffineOps.h:218
Definition: Types.h:84
void setMemRef(Value value)
Definition: AffineOps.h:412
Definition: Value.h:38
~AffineApplyNormalizer()
Definition: AffineOps.h:672
bool isSrcMemorySpaceFaster()
Returns true if this is a DMA from a slower memory space to a faster one.
Definition: AffineOps.h:267
operand_iterator operand_begin()
Definition: AffineOps.h:585
AffineMap getTagMap()
Returns the affine map used to access the tag memref.
Definition: AffineOps.h:342
bool isTopLevelValue(Value value)
Definition: AffineOps.cpp:109
Definition: LLVM.h:35
Definition: Attributes.h:175
AffineMap getTagMap()
Returns the affine map used to access the tag memref.
Definition: AffineOps.h:229
AffineMapAttr getAffineMapAttr()
Definition: AffineOps.h:422
AffineMap getSrcMap()
Returns the affine map used to access the src memref.
Definition: AffineOps.h:161
Definition: PatternMatch.h:418
Definition: Builders.h:47
MemRefType getDstMemRefType()
Definition: AffineOps.h:185
AffineMap getMap()
Definition: AffineOps.h:574
unsigned getSrcMemRefRank()
Returns the rank (number of indices) of the source MemRefType.
Definition: AffineOps.h:158
unsigned getTagMemRefRank()
Returns the rank (number of indices) of the tag MemRefType.
Definition: AffineOps.h:224
MemRefType getMemRefType()
Definition: AffineOps.h:484
A dimensional identifier appearing in an affine expression.
Definition: AffineExpr.h:177
Operation * materializeConstant(OpBuilder &builder, Attribute value, Type type, Location loc) override
Definition: AffineOps.cpp:95
static StringRef getDstMapAttrName()
Definition: AffineOps.h:281
operand_range getMapOperands()
Get affine map operands.
Definition: AffineOps.h:489
AffineMap getDstMap()
Returns the affine map used to access the dst memref.
Definition: AffineOps.h:200
unsigned getTagMemRefOperandIndex()
Returns the operand index of the tag memref.
Definition: AffineOps.h:213
Definition: MLIRContext.h:34
void print(OpAsmPrinter &p, AffineIfOp op)
Definition: AffineOps.cpp:1671
operand_range getSrcIndices()
Returns the source memref affine map indices for this DMA operation.
Definition: AffineOps.h:167
Definition: AffineOps.h:137
unsigned getDstMemorySpace()
Returns the memory space of the src memref.
Definition: AffineOps.h:195
static StringRef getOperationName()
Definition: AffineOps.h:434
AffineMapAttr getTagMapAttr()
Definition: AffineOps.h:343
unsigned getTagMemRefRank()
Definition: AffineOps.h:354
This class implements the operand iterators for the Operation class.
Definition: OperationSupport.h:559
Definition: OpDefinition.h:949
Definition: AffineOps.h:37
Definition: AffineStructures.h:112
MemRefType getTagMemRefType()
Definition: AffineOps.h:219
AffineMap getAffineMap()
Returns the affine map used to index the memref for this operation.
Definition: AffineOps.h:421
static StringRef getOperationName()
Definition: AffineOps.h:333
Definition: AffineOps.h:461
AffineMapAttr getSrcMapAttr()
Definition: AffineOps.h:162
Definition: OpDefinition.h:36
AffineMapAttr getAffineMapAttr()
Definition: AffineOps.h:493
Definition: Builders.h:158
MemRefType getMemRefType()
Definition: AffineOps.h:413
Definition: OperationSupport.h:640
operand_range getMapOperands()
Get affine map operands.
Definition: AffineOps.h:418
AffineMap getAffineMap()
Returns the affine map used to index the memref for this operation.
Definition: AffineOps.h:492
operand_range getOperands()
Definition: AffineOps.h:587
unsigned getDstMemRefOperandIndex()
Returns the operand index of the dst memref.
Definition: AffineOps.h:179
Value getStride()
Returns the stride value for this DMA operation.
Definition: AffineOps.h:298
AffineForOp getForInductionVarOwner(Value val)
Definition: AffineOps.cpp:1572
Definition: IntegerSet.h:42