diff --git a/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp b/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp --- a/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp +++ b/mlir/test/lib/Dialect/Affine/TestAffineDataCopy.cpp @@ -76,6 +76,8 @@ } } } + if (!load) + return; AffineCopyOptions copyOptions = {/*generateDma=*/false, /*slowMemorySpace=*/0, @@ -95,7 +97,7 @@ // Promote any single iteration loops in the copy nests and simplify // load/stores. SmallVector copyOps; - for (auto nest : copyNests) + for (auto *nest : copyNests) // With a post order walk, the erasure of loops does not affect // continuation of the walk or the collection of load/store ops. nest->walk([&](Operation *op) { @@ -111,7 +113,7 @@ // generated load's/store's, and the latter could anyway also be // canonicalized. RewritePatternSet patterns(&getContext()); - for (auto op : copyOps) { + for (auto *op : copyOps) { patterns.clear(); if (isa(op)) { AffineLoadOp::getCanonicalizationPatterns(patterns, &getContext());