16 #ifndef MLIR_ANALYSIS_UTILS_H 17 #define MLIR_ANALYSIS_UTILS_H 24 #include "llvm/ADT/SmallVector.h" 31 class FlatAffineConstraints;
40 void getLoopIVs(Operation &op, SmallVectorImpl<AffineForOp> *loops);
49 llvm::SmallDenseSet<Value, 8> *sequentialLoops);
124 unsigned loopDepth,
bool isBackwardSlice,
141 unsigned numCommonLoops,
bool isBackwardSlice,
156 unsigned dstLoopDepth,
210 bool addMemRefDimBounds =
true);
236 int64_t *lbFloorDivisor =
nullptr)
const {
237 assert(pos < getRank() &&
"invalid position");
238 return cst.getConstantBoundOnDimSize(pos, lb);
248 unsigned getRank()
const;
278 template <
typename LoadOrStoreOpPo
inter>
288 int memorySpace = -1);
295 #endif // MLIR_ANALYSIS_UTILS_H Definition: InferTypeOpInterface.cpp:20
Definition: Operation.h:27
SmallVector< Value, 4 > ivs
Definition: Utils.h:58
Optional< int64_t > getMemoryFootprintBytes(AffineForOp forOp, int memorySpace=-1)
Definition: Utils.cpp:953
unsigned getNestingDepth(Operation &op)
Definition: Utils.cpp:864
void getComputationSliceState(Operation *depSourceOp, Operation *depSinkOp, FlatAffineConstraints *dependenceConstraints, unsigned loopDepth, bool isBackwardSlice, ComputationSliceState *sliceState)
Definition: Utils.cpp:680
void getLoopIVs(Operation &op, SmallVectorImpl< AffineForOp > *loops)
Definition: Utils.cpp:31
Definition: Location.h:52
void clearBounds()
Definition: Utils.cpp:83
Optional< uint64_t > getMemRefSizeInBytes(MemRefType memRefType)
Definition: Utils.cpp:356
Definition: AffineStructures.h:229
Definition: LogicalResult.h:18
OpListType::iterator iterator
Definition: Block.h:107
void setWrite(bool flag)
Definition: Utils.h:215
bool isLoopParallel(AffineForOp forOp)
Returns true if `forOp' is a parallel loop.
Definition: Utils.cpp:973
bool write
Read or write.
Definition: Utils.h:254
SmallVector< AffineMap, 4 > lbs
Definition: Utils.h:60
Location loc
Definition: Utils.h:258
const FlatAffineConstraints * getConstraints() const
Definition: Utils.h:213
Block::iterator insertPoint
Definition: Utils.h:68
Definition: StandardTypes.h:390
MemRefRegion(Location loc)
Definition: Utils.h:174
void getSequentialLoops(AffineForOp forOp, llvm::SmallDenseSet< Value, 8 > *sequentialLoops)
Definition: Utils.cpp:963
unsigned getNumCommonSurroundingLoops(Operation &A, Operation &B)
Returns the number of surrounding loops common to both A and B.
Definition: Utils.cpp:894
SmallVector< AffineMap, 4 > ubs
Definition: Utils.h:62
LogicalResult boundCheckLoadOrStoreOp(LoadOrStoreOpPointer loadOrStoreOp, bool emitError=true)
Definition: Utils.cpp:371
InFlightDiagnostic emitError(Location loc)
Utility method to emit an error message using this location.
Definition: Diagnostics.cpp:301
FlatAffineConstraints * getConstraints()
Definition: Utils.h:212
std::vector< SmallVector< Value, 4 > > ubOperands
Definition: Utils.h:66
bool isWrite() const
Definition: Utils.h:214
FlatAffineConstraints cst
Definition: Utils.h:268
LogicalResult computeSliceUnion(ArrayRef< Operation *> opsA, ArrayRef< Operation *> opsB, unsigned loopDepth, unsigned numCommonLoops, bool isBackwardSlice, ComputationSliceState *sliceUnion)
Definition: Utils.cpp:520
AffineForOp insertBackwardComputationSlice(Operation *srcOpInst, Operation *dstOpInst, unsigned dstLoopDepth, ComputationSliceState *sliceState)
Definition: Utils.cpp:777
Value memref
Memref that this region corresponds to.
Definition: Utils.h:251
std::vector< SmallVector< Value, 4 > > lbOperands
Definition: Utils.h:64
LogicalResult getAsConstraints(FlatAffineConstraints *cst)
Definition: Utils.cpp:47
Optional< int64_t > getConstantBoundOnDimSize(unsigned pos, SmallVectorImpl< int64_t > *lb=nullptr, int64_t *lbFloorDivisor=nullptr) const
Definition: Utils.h:234