diff --git a/mlir/lib/Transforms/BufferPlacement.cpp b/mlir/lib/Transforms/BufferPlacement.cpp --- a/mlir/lib/Transforms/BufferPlacement.cpp +++ b/mlir/lib/Transforms/BufferPlacement.cpp @@ -296,7 +296,9 @@ if (!dominators.dominates(definingBlock, blockArg.getOwner())) { toProcess.emplace_back(blockArg, blockArg.getParentBlock()); blockArgsToFree.insert(blockArg); - } else if (visitedBlockArgs.insert({blockArg, definingBlock}).second) + } else if (visitedBlockArgs + .insert(std::make_tuple(blockArg, definingBlock)) + .second) toProcess.emplace_back(blockArg, definingBlock); } }; @@ -333,7 +335,10 @@ .getMutableSuccessorOperands(it.getSuccessorIndex()) .getValue() .slice(blockArg.getArgNumber(), 1); - Value sourceValue = ((OperandRange)successorOperand)[0]; + // Convert the mutable operand range to an immutable range and query the + // associated source value. + OperandRange range = successorOperand; + Value sourceValue = range[0]; // Create a new alloc at the current location of the terminator. auto memRefType = sourceValue.getType().cast(); diff --git a/mlir/lib/Transforms/CMakeLists.txt b/mlir/lib/Transforms/CMakeLists.txt --- a/mlir/lib/Transforms/CMakeLists.txt +++ b/mlir/lib/Transforms/CMakeLists.txt @@ -30,6 +30,7 @@ LINK_LIBS PUBLIC MLIRAffineOps MLIRAnalysis + MLIRLinalgOps MLIRLoopLikeInterface MLIRSCF MLIRPass