diff --git a/mlir/lib/Transforms/BufferPlacement.cpp b/mlir/lib/Transforms/BufferPlacement.cpp index 87b2687b6982f..0c24621c36668 100644 --- a/mlir/lib/Transforms/BufferPlacement.cpp +++ b/mlir/lib/Transforms/BufferPlacement.cpp @@ -311,7 +311,7 @@ class BufferPlacement { /// the top of the file for all alloc nodes that can be handled by this /// analysis. void placeAllocs() const { - for (auto &entry : allocs) { + for (const AllocEntry &entry : allocs) { Value alloc = entry.allocValue; // Get the actual block to place the alloc and get liveness information // for the placement block. @@ -572,7 +572,7 @@ class BufferPlacement { // These deallocations will be linked to their associated allocation nodes // since they don't have any aliases that can (potentially) increase their // liveness. - for (auto &entry : allocs) { + for (const AllocEntry &entry : allocs) { Value alloc = entry.allocValue; auto aliasesSet = aliases.resolve(alloc); assert(aliasesSet.size() > 0 && "must contain at least one alias");