diff options
Diffstat (limited to 'mlir/lib/Analysis/Utils.cpp')
-rw-r--r-- | mlir/lib/Analysis/Utils.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/mlir/lib/Analysis/Utils.cpp b/mlir/lib/Analysis/Utils.cpp index 3ba27bbb299..73aa07e7d7b 100644 --- a/mlir/lib/Analysis/Utils.cpp +++ b/mlir/lib/Analysis/Utils.cpp @@ -60,7 +60,7 @@ ComputationSliceState::getAsConstraints(FlatAffineConstraints *cst) { // Adds operands (dst ivs and symbols) as symbols in 'cst'. unsigned numSymbols = lbOperands[0].size(); - SmallVector<Value *, 4> values(ivs); + SmallVector<ValuePtr, 4> values(ivs); // Append 'ivs' then 'operands' to 'values'. values.append(lbOperands[0].begin(), lbOperands[0].end()); cst->reset(numDims, numSymbols, 0, values); @@ -185,7 +185,7 @@ LogicalResult MemRefRegion::compute(Operation *op, unsigned loopDepth, if (rank == 0) { SmallVector<AffineForOp, 4> ivs; getLoopIVs(*op, &ivs); - SmallVector<Value *, 8> regionSymbols; + SmallVector<ValuePtr, 8> regionSymbols; extractForInductionVars(ivs, ®ionSymbols); // A rank 0 memref has a 0-d region. cst.reset(rank, loopDepth, 0, regionSymbols); @@ -201,7 +201,7 @@ LogicalResult MemRefRegion::compute(Operation *op, unsigned loopDepth, unsigned numSymbols = accessMap.getNumSymbols(); unsigned numOperands = accessValueMap.getNumOperands(); // Merge operands with slice operands. - SmallVector<Value *, 4> operands; + SmallVector<ValuePtr, 4> operands; operands.resize(numOperands); for (unsigned i = 0; i < numOperands; ++i) operands[i] = accessValueMap.getOperand(i); @@ -224,7 +224,7 @@ LogicalResult MemRefRegion::compute(Operation *op, unsigned loopDepth, // Add equality constraints. // Add inequalities for loop lower/upper bounds. for (unsigned i = 0; i < numDims + numSymbols; ++i) { - auto *operand = operands[i]; + auto operand = operands[i]; if (auto loop = getForInductionVarOwner(operand)) { // Note that cst can now have more dimensions than accessMap if the // bounds expressions involve outer loops or other symbols. @@ -234,7 +234,7 @@ LogicalResult MemRefRegion::compute(Operation *op, unsigned loopDepth, return failure(); } else { // Has to be a valid symbol. - auto *symbol = operand; + auto symbol = operand; assert(isValidSymbol(symbol)); // Check if the symbol is a constant. if (auto *op = symbol->getDefiningOp()) { @@ -278,9 +278,9 @@ LogicalResult MemRefRegion::compute(Operation *op, unsigned loopDepth, getLoopIVs(*op, &enclosingIVs); assert(loopDepth <= enclosingIVs.size() && "invalid loop depth"); enclosingIVs.resize(loopDepth); - SmallVector<Value *, 4> ids; + SmallVector<ValuePtr, 4> ids; cst.getIdValues(cst.getNumDimIds(), cst.getNumDimAndSymbolIds(), &ids); - for (auto *id : ids) { + for (auto id : ids) { AffineForOp iv; if ((iv = getForInductionVarOwner(id)) && llvm::is_contained(enclosingIVs, iv) == false) { @@ -345,9 +345,9 @@ Optional<int64_t> MemRefRegion::getRegionSize() { // Indices to use for the DmaStart op. // Indices for the original memref being DMAed from/to. - SmallVector<Value *, 4> memIndices; + SmallVector<ValuePtr, 4> memIndices; // Indices for the faster buffer being DMAed into/from. - SmallVector<Value *, 4> bufIndices; + SmallVector<ValuePtr, 4> bufIndices; // Compute the extents of the buffer. Optional<int64_t> numElements = getConstantBoundingSizeAndShape(); @@ -480,10 +480,10 @@ static Operation *getInstAtPosition(ArrayRef<unsigned> positions, } // Adds loop IV bounds to 'cst' for loop IVs not found in 'ivs'. -LogicalResult addMissingLoopIVBounds(SmallPtrSet<Value *, 8> &ivs, +LogicalResult addMissingLoopIVBounds(SmallPtrSet<ValuePtr, 8> &ivs, FlatAffineConstraints *cst) { for (unsigned i = 0, e = cst->getNumDimIds(); i < e; ++i) { - auto *value = cst->getIdValue(i); + auto value = cst->getIdValue(i); if (ivs.count(value) == 0) { assert(isForInductionVar(value)); auto loop = getForInductionVarOwner(value); @@ -596,10 +596,10 @@ LogicalResult mlir::computeSliceUnion(ArrayRef<Operation *> opsA, // Pre-constraint id alignment: record loop IVs used in each constraint // system. - SmallPtrSet<Value *, 8> sliceUnionIVs; + SmallPtrSet<ValuePtr, 8> sliceUnionIVs; for (unsigned k = 0, l = sliceUnionCst.getNumDimIds(); k < l; ++k) sliceUnionIVs.insert(sliceUnionCst.getIdValue(k)); - SmallPtrSet<Value *, 8> tmpSliceIVs; + SmallPtrSet<ValuePtr, 8> tmpSliceIVs; for (unsigned k = 0, l = tmpSliceCst.getNumDimIds(); k < l; ++k) tmpSliceIVs.insert(tmpSliceCst.getIdValue(k)); @@ -659,7 +659,7 @@ LogicalResult mlir::computeSliceUnion(ArrayRef<Operation *> opsA, &sliceUnion->ubs); // Add slice bound operands of union. - SmallVector<Value *, 4> sliceBoundOperands; + SmallVector<ValuePtr, 4> sliceBoundOperands; sliceUnionCst.getIdValues(numSliceLoopIVs, sliceUnionCst.getNumDimAndSymbolIds(), &sliceBoundOperands); @@ -725,7 +725,7 @@ void mlir::getComputationSliceState( &sliceState->lbs, &sliceState->ubs); // Set up bound operands for the slice's lower and upper bounds. - SmallVector<Value *, 4> sliceBoundOperands; + SmallVector<ValuePtr, 4> sliceBoundOperands; unsigned numDimsAndSymbols = dependenceConstraints->getNumDimAndSymbolIds(); for (unsigned i = 0; i < numDimsAndSymbols; ++i) { if (i < offset || i >= offset + numSliceLoopIVs) { @@ -743,7 +743,7 @@ void mlir::getComputationSliceState( isBackwardSlice ? dstLoopIVs[loopDepth - 1].getBody()->begin() : std::prev(srcLoopIVs[loopDepth - 1].getBody()->end()); - llvm::SmallDenseSet<Value *, 8> sequentialLoops; + llvm::SmallDenseSet<ValuePtr, 8> sequentialLoops; if (isa<AffineLoadOp>(depSourceOp) && isa<AffineLoadOp>(depSinkOp)) { // For read-read access pairs, clear any slice bounds on sequential loops. // Get sequential loops in loop nest rooted at 'srcLoopIVs[0]'. @@ -758,7 +758,7 @@ void mlir::getComputationSliceState( return isBackwardSlice ? srcLoopIVs[i] : dstLoopIVs[i]; }; for (unsigned i = 0; i < numSliceLoopIVs; ++i) { - Value *iv = getSliceLoop(i).getInductionVar(); + ValuePtr iv = getSliceLoop(i).getInductionVar(); if (sequentialLoops.count(iv) == 0 && getSliceLoop(i).getAttr(kSliceFusionBarrierAttrName) == nullptr) continue; @@ -846,7 +846,7 @@ MemRefAccess::MemRefAccess(Operation *loadOrStoreOpInst) { opInst = loadOrStoreOpInst; auto loadMemrefType = loadOp.getMemRefType(); indices.reserve(loadMemrefType.getRank()); - for (auto *index : loadOp.getMapOperands()) { + for (auto index : loadOp.getMapOperands()) { indices.push_back(index); } } else { @@ -856,7 +856,7 @@ MemRefAccess::MemRefAccess(Operation *loadOrStoreOpInst) { memref = storeOp.getMemRef(); auto storeMemrefType = storeOp.getMemRefType(); indices.reserve(storeMemrefType.getRank()); - for (auto *index : storeOp.getMapOperands()) { + for (auto index : storeOp.getMapOperands()) { indices.push_back(index); } } @@ -919,7 +919,7 @@ static Optional<int64_t> getMemoryFootprintBytes(Block &block, Block::iterator start, Block::iterator end, int memorySpace) { - SmallDenseMap<Value *, std::unique_ptr<MemRefRegion>, 4> regions; + SmallDenseMap<ValuePtr, std::unique_ptr<MemRefRegion>, 4> regions; // Walk this 'affine.for' operation to gather all memory regions. auto result = block.walk(start, end, [&](Operation *opInst) -> WalkResult { @@ -970,7 +970,7 @@ Optional<int64_t> mlir::getMemoryFootprintBytes(AffineForOp forOp, /// Returns in 'sequentialLoops' all sequential loops in loop nest rooted /// at 'forOp'. void mlir::getSequentialLoops( - AffineForOp forOp, llvm::SmallDenseSet<Value *, 8> *sequentialLoops) { + AffineForOp forOp, llvm::SmallDenseSet<ValuePtr, 8> *sequentialLoops) { forOp.getOperation()->walk([&](Operation *op) { if (auto innerFor = dyn_cast<AffineForOp>(op)) if (!isLoopParallel(innerFor)) |