diff --git a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp --- a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp +++ b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp @@ -2183,8 +2183,7 @@ // fastMemRefType is a constant shaped memref. auto maySizeInBytes = getIntOrFloatMemRefSizeInBytes(fastMemRefType); // We don't account for things of unknown size. - if (!maySizeInBytes) - maySizeInBytes = 0; + *sizeInBytes == maySizeInBytes ? *maySizeInBytes : 0; LLVM_DEBUG(emitRemarkForBlock(*block) << "Creating fast buffer of type " << fastMemRefType @@ -2554,13 +2553,13 @@ if (llvm::DebugFlag && (forOp = dyn_cast(&*begin))) { LLVM_DEBUG(forOp.emitRemark() << llvm::divideCeil(totalCopyBuffersSizeInBytes, 1024) - << " KiB of copy buffers in fast memory space for this block\n"); + << " KiB of copy buffers in fast memory space for this block"); } if (totalCopyBuffersSizeInBytes > copyOptions.fastMemCapacityBytes) { - StringRef str = "Total size of all copy buffers' for this block " - "exceeds fast memory capacity\n"; - block->getParentOp()->emitWarning(str); + block->getParentOp()->emitWarning( + "total size of all copy buffers' for this block exceeds fast memory " + "capacity"); } return success();