OpBuilder topBuilder(f.getBody());
Value zeroIndex = topBuilder.create<arith::ConstantIndexOp>(f.getLoc(), 0);
+ *sizeInBytes = 0;
+
if (begin == end)
return success();
if (*numElements == 0) {
LLVM_DEBUG(llvm::dbgs() << "Nothing to copy\n");
- *sizeInBytes = 0;
return success();
}
// 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
} else {
// Reuse the one already created.
fastMemRef = fastBufferMap[memref];
- *sizeInBytes = 0;
}
auto numElementsSSA = top.create<arith::ConstantIndexOp>(loc, *numElements);
if (llvm::DebugFlag && (forOp = dyn_cast<AffineForOp>(&*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();