@@ -1550,15 +1550,17 @@ mlir::affine::computeSliceUnion(ArrayRef<Operation *> opsA,
15501550 FlatAffineValueConstraints sliceUnionCst;
15511551 assert (sliceUnionCst.getNumDimAndSymbolVars () == 0 );
15521552 std::vector<std::pair<Operation *, Operation *>> dependentOpPairs;
1553- for (Operation *i : opsA) {
1554- MemRefAccess srcAccess (i);
1555- for (Operation *j : opsB) {
1556- MemRefAccess dstAccess (j);
1553+ MemRefAccess srcAccess;
1554+ MemRefAccess dstAccess;
1555+ for (Operation *a : opsA) {
1556+ srcAccess = MemRefAccess (a);
1557+ for (Operation *b : opsB) {
1558+ dstAccess = MemRefAccess (b);
15571559 if (srcAccess.memref != dstAccess.memref )
15581560 continue ;
15591561 // Check if 'loopDepth' exceeds nesting depth of src/dst ops.
1560- if ((!isBackwardSlice && loopDepth > getNestingDepth (i )) ||
1561- (isBackwardSlice && loopDepth > getNestingDepth (j ))) {
1562+ if ((!isBackwardSlice && loopDepth > getNestingDepth (a )) ||
1563+ (isBackwardSlice && loopDepth > getNestingDepth (b ))) {
15621564 LLVM_DEBUG (llvm::dbgs () << " Invalid loop depth\n " );
15631565 return SliceComputationResult::GenericFailure;
15641566 }
@@ -1577,13 +1579,12 @@ mlir::affine::computeSliceUnion(ArrayRef<Operation *> opsA,
15771579 }
15781580 if (result.value == DependenceResult::NoDependence)
15791581 continue ;
1580- dependentOpPairs.emplace_back (i, j );
1582+ dependentOpPairs.emplace_back (a, b );
15811583
15821584 // Compute slice bounds for 'srcAccess' and 'dstAccess'.
15831585 ComputationSliceState tmpSliceState;
1584- mlir::affine::getComputationSliceState (i, j, dependenceConstraints,
1585- loopDepth, isBackwardSlice,
1586- &tmpSliceState);
1586+ getComputationSliceState (a, b, dependenceConstraints, loopDepth,
1587+ isBackwardSlice, &tmpSliceState);
15871588
15881589 if (sliceUnionCst.getNumDimAndSymbolVars () == 0 ) {
15891590 // Initialize 'sliceUnionCst' with the bounds computed in previous step.
@@ -1948,16 +1949,16 @@ AffineForOp mlir::affine::insertBackwardComputationSlice(
19481949
19491950// Constructs MemRefAccess populating it with the memref, its indices and
19501951// opinst from 'loadOrStoreOpInst'.
1951- MemRefAccess::MemRefAccess (Operation *loadOrStoreOpInst ) {
1952- if (auto loadOp = dyn_cast<AffineReadOpInterface>(loadOrStoreOpInst )) {
1952+ MemRefAccess::MemRefAccess (Operation *memOp ) {
1953+ if (auto loadOp = dyn_cast<AffineReadOpInterface>(memOp )) {
19531954 memref = loadOp.getMemRef ();
1954- opInst = loadOrStoreOpInst ;
1955+ opInst = memOp ;
19551956 llvm::append_range (indices, loadOp.getMapOperands ());
19561957 } else {
1957- assert (isa<AffineWriteOpInterface>(loadOrStoreOpInst ) &&
1958+ assert (isa<AffineWriteOpInterface>(memOp ) &&
19581959 " Affine read/write op expected" );
1959- auto storeOp = cast<AffineWriteOpInterface>(loadOrStoreOpInst );
1960- opInst = loadOrStoreOpInst ;
1960+ auto storeOp = cast<AffineWriteOpInterface>(memOp );
1961+ opInst = memOp ;
19611962 memref = storeOp.getMemRef ();
19621963 llvm::append_range (indices, storeOp.getMapOperands ());
19631964 }
0 commit comments