@@ -817,15 +817,15 @@ mlir::computeSliceUnion(ArrayRef<Operation *> opsA, ArrayRef<Operation *> opsB,
817817 FlatAffineValueConstraints sliceUnionCst;
818818 assert (sliceUnionCst.getNumDimAndSymbolIds () == 0 );
819819 std::vector<std::pair<Operation *, Operation *>> dependentOpPairs;
820- for (unsigned i = 0 , numOpsA = opsA. size (); i < numOpsA; ++i ) {
821- MemRefAccess srcAccess (opsA[i] );
822- for (unsigned j = 0 , numOpsB = opsB. size (); j < numOpsB; ++j ) {
823- MemRefAccess dstAccess (opsB[j] );
820+ for (auto i : opsA) {
821+ MemRefAccess srcAccess (i );
822+ for (auto j : opsB) {
823+ MemRefAccess dstAccess (j );
824824 if (srcAccess.memref != dstAccess.memref )
825825 continue ;
826826 // Check if 'loopDepth' exceeds nesting depth of src/dst ops.
827- if ((!isBackwardSlice && loopDepth > getNestingDepth (opsA[i] )) ||
828- (isBackwardSlice && loopDepth > getNestingDepth (opsB[j] ))) {
827+ if ((!isBackwardSlice && loopDepth > getNestingDepth (i )) ||
828+ (isBackwardSlice && loopDepth > getNestingDepth (j ))) {
829829 LLVM_DEBUG (llvm::dbgs () << " Invalid loop depth\n " );
830830 return SliceComputationResult::GenericFailure;
831831 }
@@ -844,13 +844,12 @@ mlir::computeSliceUnion(ArrayRef<Operation *> opsA, ArrayRef<Operation *> opsB,
844844 }
845845 if (result.value == DependenceResult::NoDependence)
846846 continue ;
847- dependentOpPairs.push_back ({opsA[i], opsB[j]} );
847+ dependentOpPairs.emplace_back (i, j );
848848
849849 // Compute slice bounds for 'srcAccess' and 'dstAccess'.
850850 ComputationSliceState tmpSliceState;
851- mlir::getComputationSliceState (opsA[i], opsB[j], &dependenceConstraints,
852- loopDepth, isBackwardSlice,
853- &tmpSliceState);
851+ mlir::getComputationSliceState (i, j, &dependenceConstraints, loopDepth,
852+ isBackwardSlice, &tmpSliceState);
854853
855854 if (sliceUnionCst.getNumDimAndSymbolIds () == 0 ) {
856855 // Initialize 'sliceUnionCst' with the bounds computed in previous step.
0 commit comments