summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Dialect
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-01-01 15:55:14 -0800
committerFangrui Song <maskray@google.com>2020-01-01 16:06:04 -0800
commiteeef50b1fee91dbe993187324003d2665ceae331 (patch)
tree15f68eb8fac2485d6624d4962f011dc8d64bce73 /mlir/lib/Dialect
parent681b1be774964a804beabfb7c5e3bdab8f979e4a (diff)
downloadbcm5719-llvm-eeef50b1fee91dbe993187324003d2665ceae331.tar.gz
bcm5719-llvm-eeef50b1fee91dbe993187324003d2665ceae331.zip
[mlir] Fix -Wrange-loo-analysis warnings
for (const auto &x : llvm::zip(..., ...)) -> for (auto x : llvm::zip(..., ...)) The return type of zip() is a wrapper that wraps a tuple of references. > warning: loop variable 'p' is always a copy because the range of type 'detail::zippy<detail::zip_shortest, ArrayRef<long> &, ArrayRef<long> &>' does not return a reference [-Wrange-loop-analysis]
Diffstat (limited to 'mlir/lib/Dialect')
-rw-r--r--mlir/lib/Dialect/Traits.cpp2
-rw-r--r--mlir/lib/Dialect/VectorOps/VectorOps.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/mlir/lib/Dialect/Traits.cpp b/mlir/lib/Dialect/Traits.cpp
index 3aea206c07e..744500af663 100644
--- a/mlir/lib/Dialect/Traits.cpp
+++ b/mlir/lib/Dialect/Traits.cpp
@@ -151,7 +151,7 @@ static bool areCompatibleShapes(ArrayRef<int64_t> shape1,
};
if (shape1.size() != shape2.size())
return false;
- for (const auto &p : llvm::zip(shape1, shape2))
+ for (auto p : llvm::zip(shape1, shape2))
if (!isCompatible(std::get<0>(p), std::get<1>(p)))
return false;
return true;
diff --git a/mlir/lib/Dialect/VectorOps/VectorOps.cpp b/mlir/lib/Dialect/VectorOps/VectorOps.cpp
index a3904ef97a2..4afd05758ed 100644
--- a/mlir/lib/Dialect/VectorOps/VectorOps.cpp
+++ b/mlir/lib/Dialect/VectorOps/VectorOps.cpp
@@ -1349,7 +1349,7 @@ public:
// Compute slice of vector mask region.
SmallVector<int64_t, 4> sliceMaskDimSizes;
assert(sliceOffsets.size() == maskDimSizes.size());
- for (const auto &it : llvm::zip(maskDimSizes, sliceOffsets, sliceSizes)) {
+ for (auto it : llvm::zip(maskDimSizes, sliceOffsets, sliceSizes)) {
int64_t maskDimSize = std::get<0>(it);
int64_t sliceOffset = std::get<1>(it);
int64_t sliceSize = std::get<2>(it);
OpenPOWER on IntegriCloud